home *** CD-ROM | disk | FTP | other *** search
/ Utilities Professional 1-1500 / Utilities Professional 1-1500 (1994)(WPD)[!].iso / 12511500 / var1463.dms / var1463.adf / BBBBS72.lha / rexx / bbsLOCAL.rexx < prev    next >
OS/2 REXX Batch file  |  1994-04-16  |  171KB  |  6,238 lines

  1. /*             $VER: bbsLOCAL.rexx 7.2 (16.4.94)
  2. bbsLOCAL.rexx 7.2 © 1990-94 Richard Lee Stockton 16 Apr 94 11:47PM
  3.    - FREELY DISTRIBUTABLE AS LONG AS THIS NOTICE REMAINS -
  4.  
  5.             BBBBS.baud without the BaudBandit stuff
  6.    Will multi-task with BBBBS.baud (within limits, see docs)
  7.  THIS IS THE SYSOP'S VERSION OF BBBBS.baud FOR LOCAL USE ONLY!
  8. */
  9.  
  10. copyright.=''
  11. copyright.1=STRIP(SOURCELINE(2))
  12. copyright.2='
  13. Gramma Software 21305-60th Ave West, Mountlake Terrace WA 98043-2009'
  14. copyright.3='
  15. ARexx portions of this software copyright 1990-93 Richard Lee Stockton'
  16. copyright.4='- FREELY DISTRIBUTABLE as long as this notice remains -'
  17.  
  18. /* If the QuickSortPort not found then try to run setup.rexx */
  19.  
  20. IF ~show('P','QuickSortPort') THEN CALL setup.rexx()
  21. IF ~show('P','QuickSortPort') THEN EXIT
  22.  
  23. IF SHOW('P','BBBBS_LOCAL') THEN
  24.   DO
  25.     SAY 'bbsLOCAL.rexx is already running!'
  26.     EXIT 0
  27.   END
  28. IF SHOW('P','BBBBS') & GETCLIP('BBS_maint')~='' THEN
  29.   DO
  30.     SAY 'BBS_maint flag is set. Wait until processing is finished, then restart.'
  31.     EXIT 0
  32.   END
  33. CALL SETCLIP('BBS_mainfiles')
  34. CALL SETCLIP('BBS_mainusers')
  35. CALL OPENPORT('BBBBS_LOCAL')
  36.  
  37. PARSE VERSION . . cpu .
  38. cpu=RIGHT(cpu,2)/10
  39. IF cpu<1 THEN cpu=1
  40.  
  41. /* BBS Directories (may be created with SETUP option) */
  42. bbs.=''
  43. bbs.1='Information' /* text files from sysop for the user to read */
  44. bbs.6='Scratch'
  45. bbs.7='BBS_HELP'
  46. bbs.8='rexxDoors'
  47. bbs.9='BBS_TEXT'    /* text files for BBS use. WELCOME HELLO, NEW etc. */
  48. bbs.10='FileNotes'
  49. bbs.11='BBS_LIBS'
  50. bbs.12='BBS_MSGS'
  51. bbs.13='Lists'
  52. bbs.14='Numbers'    /* 1st & last messages, mail, files */
  53. bbs.15='Usage'
  54. bbs.16='Logs'
  55. bbs.17='EMailFiles'
  56. bbs.18='EMail'
  57. bbs.19='Users'
  58.  
  59.  
  60. /* VARIABLES */
  61.  
  62. bbsprefs.=0 /* start with all prefs OFF */
  63. namemask=COMPRESS(XRANGE(),XRANGE('A','Z')' _-')
  64. alpha.=''
  65. lastread.=0
  66. dirnum=1
  67. linesperpage=20
  68. sortuserflag=0
  69. sortalphaflag=0
  70. savefileflag=0
  71. emailonline=-1
  72. level=0
  73. lastread.=0
  74. totwrit.=0
  75. lastbrowse=0
  76. warnings=0
  77. winnings=0
  78. nonstop=0
  79. newfilesdate=''
  80. newpassword=''
  81. replysubj=''
  82. msgdir=1
  83. menuflag=1
  84. logonflag=1
  85. data.=''
  86.  
  87.  
  88. /* TEXT - User data structure by line */
  89.  
  90. text.=''
  91. text.1='   Full Name'
  92. text.2='      Street'
  93. text.3='City, ST Zip'
  94. text.4=' Voice Phone'
  95. text.5='    Password'
  96. text.6='    Protocol'
  97. text.7='LinesPerPage'
  98. text.8=' Preferences'
  99. text.9='    Computer'
  100. text.10='   Interests'
  101. text.11='Session Time'
  102. text.12='FirstSession'
  103. text.13='Last Session'
  104. text.14='      UpLoad'
  105. text.15='    Download'
  106. text.16='   Last File'
  107. text.17='Ratio  Email'
  108. text.18='    Winnings'
  109. text.19='       Usage'
  110. text.20='       Level'
  111. text.21='Exclude DIRS'
  112. text.22='   Msgs Read'
  113. text.23='   Msgs Writ'
  114. text.24=' Marked Msgs'
  115. text.25='Marked Files'
  116. text.26='QUICKexclude'
  117. text.27=' CBV numbers'
  118.  
  119.  
  120. /* try to trap everything */
  121.  
  122. SIGNAL ON BREAK_C
  123. OPTIONS RESULTS
  124. OPTIONS FAILAT 999999
  125. SIGNAL ON BREAK_E
  126. SIGNAL ON SYNTAX
  127. SIGNAL ON FAILURE
  128. NUMERIC DIGITS 14
  129.  
  130.  
  131. ARG option .
  132.  
  133. SAY CENTER(copyright.1,75)
  134. CALL config()
  135.  
  136. IF ~EXISTS(bbspath'Numbers/FirstLogon') THEN
  137.   ADDRESS COMMAND 'C:Date >'bbspath'Numbers/FirstLogon'
  138.  
  139. SAY CENTER(copyright.2,75)
  140. SAY CENTER(copyright.3,75)
  141. SAY CENTER(copyright.4,75)
  142. SAY
  143.  
  144.  
  145. IF option='SETUP' THEN
  146.   DO
  147.     SAY 'Making sure all needed directories are here...'
  148.     DO i=1 TO 20
  149.       IF bbs.i~='' THEN CALL MAKEDIR(bbspath||bbs.i)
  150.     END
  151.   END
  152.  
  153. CALL colors(1)
  154.  
  155. msg.=''
  156. IF readopen(bbspath'Lists/Conferences') THEN
  157.   DO
  158.     DO i=1
  159.       line=READLN(f)
  160.       IF line='END' THEN BREAK
  161.       IF EOF(f) THEN BREAK
  162.       num=WORD(line,1)
  163.       IF DATATYPE(num,'W') THEN msg.num=WORD(line,2)
  164.     END
  165.     CALL CLOSE(f)
  166.   END
  167. IF option='SETUP' THEN
  168.   DO
  169.     DO i=1 TO 99
  170.       IF msg.i~='' THEN CALL MAKEDIR(msgpath||i)
  171.     END
  172.   END
  173.  
  174. courtesy=''
  175. IF EXISTS(bbspath'Lists/Courtesy') THEN
  176.   DO
  177.     IF readopen(bbspath'Lists/Courtesy') THEN
  178.       DO
  179.         DO i=1
  180.           line=READLN(f)
  181.           IF EOF(f) THEN BREAK
  182.           courtesy=courtesy line
  183.         END
  184.         CALL CLOSE(f)
  185.       END
  186.   END
  187.  
  188. dirs.=''
  189. IF readopen(bbspath'Lists/Libraries') THEN
  190.   DO
  191.     DO i=1
  192.       line=READLN(f)
  193.       IF line='END' | EOF(f) THEN LEAVE i
  194.       num=WORD(line,1)
  195.       IF DATATYPE(num,'W') THEN dirs.num=STRIP(WORD(line,2))
  196.     END
  197.     CALL CLOSE(f)
  198.   END
  199. IF option='SETUP' THEN
  200.   DO
  201.     SAY 'Making sure all file library directories are here...'
  202.     DO i=1 TO 99
  203.       IF dirs.i~='' THEN
  204.         DO
  205.           CALL MAKEDIR(libpath||dirs.i)
  206.           CALL MAKEDIR(bbspath'FileNotes/'dirs.i)
  207.         END
  208.     END
  209.   END
  210.  
  211. CALL loaduserlist()
  212. SAY '          The larger the BBS gets, the longer the setup takes...'
  213.  
  214. files.=''
  215. IF readopen(bbspath'Lists/Files') THEN
  216.   DO
  217.     DO i=1
  218.       line=READLN(f)
  219.       IF EOF(f) THEN BREAK
  220.       num=WORD(line,1)
  221.       IF DATATYPE(num,'W') THEN files.num=WORD(line,2) WORD(line,3)
  222.     END
  223.     files.0=i-1
  224.     CALL CLOSE(f)
  225.   END
  226. CALL loadalpha()
  227. CALL set_grand()
  228.  
  229. BIG_LOOP:
  230. /** Identify (title) message */
  231. IF EXISTS(bbspath'BBS_TEXT/HELLO') THEN
  232.   DO
  233.     SAY 
  234.     arg=bbspath'BBS_TEXT/HELLO'
  235.     CALL readlines(arg 1)
  236.     CALL seelines(0)
  237.   END
  238. SAY
  239. SAY pen3'Courtesy List:'def
  240. SAY courtesy
  241. SAY
  242.  
  243.  
  244. /* Ask for name */
  245. name=''
  246. DO count=1 TO 3
  247.   name=getinput(1 0 'Please enter name: ')
  248.   name=SPACE(name,1,'_')
  249.   IF name='NEW' THEN LEAVE count
  250.   IF name~='' THEN
  251.     DO
  252.       IF FIND(userlist,name)>0 THEN LEAVE count
  253.       IF FIND(exclusion,name)>0 THEN
  254.         DO
  255.           SAY 'Sorry, that is a reserved name.'
  256.           name=''
  257.           ITERATE count
  258.         END
  259.       IF bbsprefs.7>0 | FIND(courtesy,name)>0 THEN
  260.         DO
  261.           SAY
  262.           SAY 'Welcome' name'!'
  263.           SAY 'You will be automatically validated after you enter your user info.'
  264.           SAY
  265.           LEAVE count
  266.         END
  267.     END
  268.   IF count<3 THEN SAY 'New Users please enter NEW to apply for validation.'
  269. END
  270. IF count>3 THEN SIGNAL DONE
  271. CALL checkUser()
  272. IF UPPER(WORD(data.12,3))~='BIRTHDAY:' THEN
  273.   DO
  274.     SAY
  275.     SAY 'Please help us out by entering the following information.'
  276.     CALL getbirth()
  277.     SAY '   Thank you!'
  278.   END
  279. CALL checkclips()
  280. city=docity(data.3)
  281.  
  282. CALL TIME('R')
  283.  
  284. IF RIGHT(WORD(data.12,4),4)=RIGHT(DATE('S'),4) THEN
  285.   DO
  286.     arg=bbspath'BBS_TEXT/BIRTHDAY'
  287.     IF EXISTS(arg) THEN 
  288.       DO
  289.         SAY
  290.         CALL showtext(arg)
  291.       END
  292.     SAY
  293.     SAY '***  Happy Birthday,' pen3||data.1||def', and many more!  ***'
  294.     SAY
  295.   END
  296. SAY 
  297.  
  298. CALL SETCLIP('BBS_LOCAL',name)
  299. CALL bbsLOGON.baud(name level)
  300. CALL sortlibraries()
  301. IF FIND(data.8,'QUICK')>0 THEN CALL do_quick(0)
  302.  
  303.  
  304. /*
  305. Opening Display after logon. Seen by all Users ONCE A DAY. It first
  306. looks for a unique yearly data (ie, WELCOME.0704), then daily data
  307. (ie, WELCOME.Fri), and then a simple, everyday 'WELCOME' datafile.
  308. */
  309.  
  310. IF DATE('I')>lastondate THEN
  311.   DO
  312.     SAY
  313.     arg=bbspath'BBS_TEXT/WELCOME.'RIGHT(DATE('S'),4)
  314.     IF EXISTS(arg) THEN CALL showtext(arg)
  315.     SAY
  316.     arg=bbspath'BBS_TEXT/WELCOME.'LEFT(DATE('W'),3)
  317.     IF EXISTS(arg) THEN CALL showtext(arg)
  318.     SAY
  319.     arg=bbspath'BBS_TEXT/WELCOME'
  320.     IF EXISTS(arg) THEN CALL showtext(arg)
  321.  
  322. /*
  323. Looks for files in the format  LEVEL.low-high, ie "LEVEL.50-80" will only
  324. be seen by users with a level >= 50 and <= 80.
  325. */
  326.  
  327.     levels.=''
  328.     IF FileList(bbspath'BBS_TEXT/LEVEL.*',levels)>0 THEN
  329.       DO
  330.         DO ui=1 TO levels.0
  331.           p=LASTPOS('.',levels.ui)
  332.           x=SUBSTR(levels.ui,p+1)
  333.           PARSE VAR x lo'-'hi .
  334.           IF ~DATATYPE(lo,'W') | ~DATATYPE(hi,'W') THEN ITERATE ui
  335.           IF lo>level | hi<level THEN ITERATE ui
  336.           DO
  337.             SAY
  338.             CALL showtext(levels.ui)
  339.           END
  340.         END
  341.       END
  342.  
  343. /*
  344. Looks for format UNTIL.YYYYMMDD ie, "UNTIL.19920514"
  345. Deletes any that are previous to "today"
  346. */
  347.  
  348.     untils.=''
  349.     IF FileList(bbspath'BBS_TEXT/UNTIL.*',untils)>0 THEN
  350.       DO
  351.         CALL QSORT(1,untils.0,untils)
  352.         DO ui=1 TO untils.0
  353.           IF RIGHT(untils.ui,8)<DATE('S') THEN CALL DELETE(untils.ui)
  354.           ELSE
  355.             DO
  356.               SAY
  357.               CALL showtext(untils.ui)
  358.             END
  359.         END
  360.       END
  361.     DROP untils.
  362.   END
  363.  
  364. IF bbsprefs.1 & ~terseflag THEN
  365.   DO
  366.     IF doGrin()>3 THEN CALL waiting()
  367.     IF EXISTS(bbspath'rexxDoors/Moon.rexx') THEN CALL Moon.rexx()
  368.     IF EXISTS(bbspath'rexxDoors/Time.rexx') THEN CALL Time.rexx()
  369.     IF FIND(UPPER(SHOWLIST('A')),'TODAY')>0 THEN
  370.       DO
  371.         IF EXISTS('RAM:TODAY') THEN
  372.           DO
  373.             finfo=STATEF('RAM:TODAY')
  374.             IF WORD(finfo,5)~=DATE('I') THEN
  375.               ADDRESS COMMAND 'C:Today091 >RAM:TODAY'
  376.           END
  377.         ELSE ADDRESS COMMAND 'C:Today091 >RAM:TODAY'
  378.         IF EXISTS('RAM:TODAY') THEN
  379.           DO
  380.             CALL readlines('RAM:TODAY' 1)
  381.             CALL seelines(0)
  382.           END
  383.       END
  384.     SAY
  385.   END
  386.  
  387. CALL readmail(0)
  388. IF ~terseflag THEN
  389.   DO
  390.     IF level>sysoplevel THEN
  391.       DO
  392.         lstmail=WORD(data.17,3)
  393.         IF ~DATATYPE(lstmail,'W') THEN lstmail=0
  394.         IF countcheck(bbspath'Numbers/LastMail' 0)>lstmail THEN
  395.           IF getinput(1 1 'Check Email? (Ny) > ')='Y' THEN CALL mailreport()
  396.         IF level<99 THEN
  397.           DO
  398.             SAY
  399.             CALL showtext(bbspath'Email/'sysop'/NEW_FILES')
  400.           END
  401.         SAY
  402.         CALL showtext(bbspath'Lists/NEW_USERS')
  403.         CALL showtext(bbspath'Lists/CBV_USERS')
  404.       END
  405.     CALL logonstats()
  406.     CALL newinfo()
  407.   END
  408. CALL showmarked(1)
  409. CALL setdir(libpath||dirs.1)
  410. logonflag=0
  411.  
  412.  
  413. /***** MAIN *****/
  414.  
  415. IF menu~='ALL' THEN menu='MAIN'
  416.  
  417. RESTART:
  418. SIGNAL ON BREAK_C
  419. SIGNAL ON BREAK_E
  420.  
  421. waitchar=''
  422. string=''
  423. opt=''
  424. IF level<1 THEN menu='NEW'
  425. DO WHILE(opt~='G')
  426.   go=0
  427.   DO WHILE(~go)
  428.     IF waitchar='' | waitchar='?' THEN
  429.       DO
  430.         commands='cghiqsvwxyz!#,'
  431.         IF level>0  THEN commands='abcdefghijlmnoprstuvwxyz!$#&.,+'
  432.         IF level>sysoplevel THEN commands=commands'k%^()=;'
  433.         IF level=99 THEN commands=commands'@~'
  434.         commands=commands'?'
  435.         IF menuflag | waitchar='?' | string='?' THEN
  436.           DO
  437.             opt='MENU'
  438.             arg=''
  439.             CALL menus()
  440.           END
  441.         ELSE SAY pen3'COMMANDS:'def commands
  442.       END
  443.     line=''
  444.     line=line||bak2' 'TIME('C')' 'def
  445.     IF menu='ALL' | menu='FILE' THEN
  446.       line=line pen3'FILE_LIBRARY:'plaindir||def
  447.     ELSE IF menu='MSG' THEN line=line pen3'MESSAGES:'def
  448.     ELSE line=line pen3'MAIN:'def
  449.     line=line'  'bbsname
  450.     IF waitchar='' THEN waitchar=getinput(0 0 line' > ')
  451.     PARSE VAR waitchar string' 'arg
  452.     nonstop=0
  453.     string=UPPER(STRIP(string))
  454.     IF clr~='' THEN SAY clr
  455.     x=GETCLIP('BBS_LOCAL_MSG')
  456.     IF x~='' THEN
  457.       DO
  458.         CALL SETCLIP('BBS_LOCAL_MSG')
  459.         SAY
  460.         SAY bak2' Message from BBBBS: 'def
  461.         SAY x
  462.         SAY
  463.         CALL waiting()
  464.       END
  465.     IF string='OFF' | string='BYE' THEN SIGNAL LOGOUT
  466.     IF string='FL' & level>0 THEN CALL Friends()
  467.     CALL checkalias()
  468.     waitchar=''
  469.     IF DATATYPE(string,'W') THEN
  470.       DO
  471.         IF string>level THEN
  472.           DO
  473.             arg=STRIP(string arg)
  474.             string='D'
  475.           END
  476.         ELSE
  477.           DO
  478.             dirnum=string
  479.             CALL chdir2()
  480.             CALL since()
  481.           END
  482.       END
  483.     IF string='QUICK' & level>0 THEN CALL do_quick(1)
  484.     opt=left(string,1)
  485.     go=1
  486.     IF POS(opt,UPPER(commands))=0 THEN go=0
  487.   END
  488.   OPTIONS PROMPT 'Filename: '
  489.   SELECT
  490.     WHEN opt='A' THEN CALL showalpha()
  491.     WHEN opt='B' THEN CALL browse()
  492.     WHEN opt='C' THEN CALL editor('MAIL' sysop)
  493.     WHEN opt='D' THEN CALL dload()
  494.     WHEN opt='E' THEN CALL readmail(1)
  495.     WHEN opt='F' THEN CALL do_F()
  496.     WHEN opt='H' THEN CALL help('MAIN')
  497.     WHEN opt='I' THEN CALL information()
  498.     WHEN opt='J' THEN CALL jump2rexx()
  499.     WHEN opt='K' THEN CALL killuser()
  500.     WHEN opt='L' THEN CALL list()
  501.     WHEN opt='M' THEN IF menu~='ALL' THEN menu='MSG'
  502.     WHEN opt='N' THEN CALL newfiles()
  503.     WHEN opt='O' THEN CALL otheruser()
  504.     WHEN opt='P' THEN CALL editor('MSG')
  505.     WHEN opt='R' THEN CALL readmessages()
  506.     WHEN opt='S' THEN CALL bbsSEARCH()
  507.     WHEN opt='U' THEN CALL uload(1)
  508.     WHEN opt='V' THEN CALL showtext(bbspath'Usage/USER.LOG')
  509.     WHEN opt='W' THEN CALL showuserlist()
  510.     WHEN opt='X' THEN CALL switchmenuflag()
  511.     WHEN opt='Y' THEN CALL edituser()
  512.     WHEN opt='Z' THEN CALL counts()
  513.     WHEN opt='~' THEN CALL sysED(1)
  514.     WHEN opt='@' THEN CALL shell()
  515.     WHEN opt='#' THEN CALL switchcolors()
  516.     WHEN opt='$' THEN IF menu='ALL' THEN menu='MAIN'; ELSE menu='ALL'
  517.     WHEN opt='%' THEN CALL editnote()
  518.     WHEN opt='^' THEN CALL readlogs()
  519.     WHEN opt='&' THEN CALL profiles()
  520.     WHEN opt=';' THEN CALL changename()
  521.     WHEN opt='(' THEN CALL filereport()
  522.     WHEN opt=')' THEN CALL mailreport()
  523.     WHEN opt='=' THEN CALL levelreport()
  524.     WHEN opt='+' THEN CALL ext_dload()
  525.     WHEN opt='.' THEN menu='MAIN'
  526.     WHEN opt=',' THEN DO;CALL hourly();CALL waiting();END
  527.     WHEN opt='?' & menuflag THEN CALL help('MAIN')
  528.     OTHERWISE NOP
  529.   END
  530. END
  531. SIGNAL LOGOUT
  532. EXIT
  533.  
  534.  
  535.  
  536. /* FUNCTIONS */
  537.  
  538.  
  539. do_F:
  540. IF menu='FILE' | menu='ALL' THEN
  541.   DO
  542.     IF STORAGE()<(bbsprefs.15+100000) | GETCLIP('BBS_libs.0')~='' THEN
  543.       DO
  544.         SAY
  545.         SAY 'Sorry! Not enough memory left for background archiving.'
  546.         SAY 'Please try again in 10 minutes or so.'
  547.         SAY
  548.         RETURN
  549.       END
  550.     DO i=0 TO libs.0
  551.       CALL SETCLIP('BBS_libs.'i,libs.i)
  552.     END
  553.     IF Make_BrowseList.baud(name colorflag files.0)=0 THEN
  554.       IF emailonline>=0 THEN emailonline=emailonline+1
  555.     DO i=0 TO libs.0
  556.       CALL SETCLIP('BBS_libs.'i)
  557.     END
  558.   END
  559. ELSE IF menu~='ALL' THEN menu='FILE'
  560. RETURN
  561.  
  562.  
  563. cleanstring:
  564. PARSE ARG nflag':'cstr
  565. IF nflag=1 THEN
  566.   DO
  567.     cstr=COMPRESS(cstr,"'`")
  568.     cstr=TRANSLATE(cstr,,namemask)
  569.     cstr=SPACE(cstr,1,'_')
  570.     RETURN cstr
  571.   END
  572. bot=XRANGE(,'1F'x)
  573. bot=COMPRESS(bot,'1B'x)  /* ESC for ANSI */
  574. top=XRANGE('7F'x)
  575. cstr=COMPRESS(cstr,bot||top)
  576. IF nflag=0 THEN cstr=STRIP(cstr)
  577. RETURN cstr
  578.  
  579.  
  580. showtext:
  581. PARSE ARG arg .
  582. IF EXISTS(arg) THEN
  583.   DO
  584.     CALL readlines(arg 1)
  585.     CALL seelines(1)
  586.     nonstop=0
  587.     CALL waiting()
  588.   END
  589. RETURN
  590.  
  591.  
  592. doGrin:
  593. IF ~EXISTS(bbspath'rexxDoors/Grin_du_Jour.rexx') THEN RETURN 0
  594. CALL setdir(bbspath'rexxDoors')
  595. temp=Grin_du_Jour.rexx()
  596. SAY
  597. RETURN temp
  598.  
  599.  
  600. do_quick:
  601. ARG flag .
  602. IF FIND(UPPER(data.8),'QUICK')=0 THEN
  603.   DO
  604.     SAY
  605.     SAY 'The QUICK option is OFF in your current settings.'
  606.     SAY
  607.     SAY 'Setting the QUICK option to ON will allow you to tell the BBS to'
  608.     SAY 'make a .lha archive of all new bbs activity since your last call.'
  609.     SAY
  610.     SAY 'This archive can then be read (and replied to, and files can be'
  611.     SAY 'uploaded and downloaded) using 'pen3'bbsQUICK.rexx'def', the offline read/reply'
  612.     SAY 'module for BBBBS, which is available here in the file libraries.'
  613.     SAY
  614.     IF getinput(1 1 'Turn the QUICK option ON? (Ny) > ')~='Y' THEN RETURN
  615.     data.8=data.8 'QUICK'
  616.     CALL saveData(0)
  617.   END
  618. ELSE IF flag=1 THEN
  619.   DO
  620.     IF getinput(1 1 'Turn the QUICK option OFF? (Ny) > ')='Y' THEN
  621.       DO 
  622.         temp=data.8
  623.         data.8=''
  624.         DO i=1 TO WORDS(temp)
  625.           IF WORD(temp,i)~='QUICK' THEN data.8=STRIP(data.8 WORD(temp,i))
  626.         END
  627.         ADDRESS COMMAND 'c:delete' bbspath'EmailFiles/'name'/QUICK_#?'
  628.         RETURN
  629.       END
  630.   END
  631. IF getinput(1 1 'Edit your QUICK exclude list? (Ny) > ')='Y' THEN
  632.   DO
  633.     SAY
  634.     SAY 'You may EXCLUDE any of these from your QUICK archives.'
  635.     SAY pen3||LEFT('-',74,'-')||def
  636.     temp=LEFT(' ',7)
  637.     SAY temp'HELLO          - Pre-logon message.'
  638.     SAY temp'WELCOME        - Post-logon message.'
  639.     SAY temp'GOODBYE        - Logoff message.'
  640.     SAY temp'HOURLY         - Average-Minutes-Per-Hour usage graph.'
  641.     SAY temp'STATS.BBS      - Most of the Z command from the main menu.'
  642.     SAY temp'filename       - ANY filename in the Information area.'
  643.     SAY temp'MESSAGES       - New conference messages.'
  644.     SAY temp'FILELIST       - New file descriptions.'
  645.     SAY pen3||LEFT('-',74,'-')||def
  646.     SAY 'Enter a space separated list of what you wish to exclude.'
  647.     SAY pen3'Exclude:'def data.26
  648.     temp=getinput(1 0 pen3'Exclude: 'def)
  649.     IF temp='' & data.26~='' THEN
  650.       DO
  651.         IF getinput(1 1 'Clear the QUICK exclude list? (nY) > ')~='N' THEN
  652.           data.26=''
  653.       END
  654.     ELSE data.26=temp
  655.     temp='Your QUICK archives will exclude'pen3
  656.     IF data.26='' THEN temp=temp 'nothing!'
  657.     ELSE temp=temp data.26
  658.     SAY temp||def
  659.     CALL savedata(0)
  660.     SAY
  661.   END
  662. IF GETCLIP('BBS_'name)~='' THEN
  663.   DO
  664.     SAY
  665.     SAY 'The QUICK routines are still working on your archive...'
  666.     SAY 'Please try again later.'
  667.     SAY
  668.     RETURN
  669.   END
  670. quickdir=bbspath'EmailFiles/'name
  671. CALL MAKEDIR(quickdir)
  672. CALL setdir(quickdir)
  673. IF getinput(1 1 'Do you have a QUICKIN file to upload? (Ny) > ')='Y' THEN
  674.   DO
  675.     arg='QUICKIN.lha'
  676.     ul=2
  677.     DO WHILE ul=2
  678.       ul=uload(0)
  679.     END
  680.   END
  681. IF EXISTS(bbspath'EmailFiles/'name'/QUICKIN.lha') & level>=sysoplevel THEN
  682.   IF getinput(1 1 'Process your QUICKIN archive [N]ow or at [L]ogoff? (Ln) > ')='N' THEN
  683.     DO
  684.       SAY
  685.       SAY 'Please wait, processing QUICKIN archive...'
  686.       CALL bbsQUICKIN.rexx(name level sysoplevel bbsprefs.6)
  687.       CALL checkclips()
  688.       CALL loadData()
  689.       SAY
  690.     END
  691. IF GETCLIP('BBS_'name)='QUICK' THEN
  692.   DO
  693.     SAY
  694.     SAY 'The QUICK routines are still working on your file(s)...'
  695.     SAY
  696.     RETURN
  697.   END
  698. arg='RAM:dirlist'
  699. ADDRESS COMMAND 'C:list >'arg quickdir'/QUICK_#? DATES'
  700. IF WORD(STATEF(arg),2)>80 THEN
  701.   DO
  702.     CALL readlines(arg 1)
  703.     CALL seelines(0)
  704.     SAY
  705.   END
  706. efiles=UPPER(SHOWDIR(quickdir))
  707. DO qi=1 TO WORDS(efiles)
  708.   qarg=WORD(efiles,qi)
  709.   IF LEFT(qarg,6)='QUICK_' & RIGHT(qarg,4)='.LHA' THEN
  710.     DO
  711.       SAY qarg 'is' WORD(STATEF(qarg),2) 'bytes.'
  712.       arg=qarg
  713.       DO WHILE dload()=1
  714.       END
  715.       t=''
  716.       DO WHILE t~='N' & t~='Y'
  717.         t=getinput(1 1 'Delete' qarg'? (ny) > ')
  718.       END
  719.       IF t='Y' THEN
  720.         DO
  721.           IF DELETE(quickdir'/'qarg)=1 THEN SAY qarg 'deleted.'
  722.           CALL DELETE(quickdir'/'qarg'.xdl')
  723.           qarg=COMPRESS(UPPER(qarg),'QUICK_.LHA')
  724.           CALL DELETE(bbspath'Email/'name'/BBBBS.'qarg)
  725.         END
  726.     END
  727. END
  728. arg=''
  729. SAY
  730. IF GETCLIP('BBS_'name)~='' THEN RETURN
  731. IF getinput(1 1 'Archive new BBS activity now? (Ny) > ')='Y' THEN
  732.   DO
  733.     CALL SETCLIP('BBS_city',city)
  734.     CALL SETCLIP('BBS_'name'_26',data.26)
  735.     IF FIND(UPPER(data.26),'STATS.BBS')=0 THEN
  736.       CALL SETCLIP('BBS_statsarg',emailonline grand grand2 files.0)
  737.     IF FIND(UPPER(data.26),'MESSAGES')=0 THEN
  738.       CALL SETCLIP('BBS_'name'_22',data.22)
  739.     CALL MAKEDIR(bbspath'EmailFiles/'name)
  740.     CALL showmarked(0)
  741.     CALL SETCLIP('BBS_QUICKOUT_BAUD',bps)
  742.     ADDRESS AREXX bbsQUICKOUT.rexx name level lastbrowse WORD(data.16,2) data.21
  743.     IF FIND(UPPER(data.26),'MESSAGES')=0 THEN
  744.       DO
  745.         clear_marked=1
  746.         DO i=1 TO level
  747.           IF WORD(data.22,i)~=-1 THEN
  748.             lastread.i=countcheck(bbspath'Numbers/LastMessage'i 0)
  749.         END
  750.         SAY
  751.       END
  752.     IF FIND(UPPER(data.26),'FILELIST')=0 THEN
  753.       lastbrowse=countcheck(bbspath'Numbers/LastFile' 0)
  754.     newfilesdate=DATE('S') TIME()
  755.     IF writeopen(bbspath'EmailFiles/'name'/Libraries') THEN
  756.       DO
  757.         DO i=1 TO libs.0
  758.           CALL WRITELN(f,libs.i)
  759.         END
  760.         CALL CLOSE(f)
  761.       END
  762.     IF writeopen(bbspath'EmailFiles/'name'/Conferences') THEN
  763.       DO
  764.         DO i=1 TO msgs.0
  765.           CALL WRITELN(f,msgs.i)
  766.         END
  767.         CALL CLOSE(f)
  768.       END
  769.     SAY
  770.     IF getinput(1 1 'Logoff Now? (nY) > ')~='N' THEN
  771.       DO
  772.         SAY 'Your archive will be waiting next time you call...'
  773.         SAY
  774.         SIGNAL LOGOUT2
  775.       END
  776.     SAY
  777.     SAY 'Note: You now have no ''new'' files or messages (they are being archived).'
  778.     SAY
  779.     CALL saveData(1)
  780.     CALL waiting()
  781.   END
  782. ELSE
  783.   DO
  784.     SAY
  785.     IF getinput(1 1 'Logoff Now? (nY) > ')~='N' THEN SIGNAL LOGOUT2
  786.   END
  787. SAY
  788. RETURN
  789.  
  790.  
  791. killuser:
  792. IF level<=sysoplevel THEN RETURN
  793. killcount=0
  794. DO loop=1
  795.   IF arg='' THEN
  796.     DO
  797.       OPTIONS PROMPT 'RETURN=QUIT  Username to Kill: '
  798.       PULL arg
  799.     END
  800.   IF STRIP(arg)='' THEN LEAVE loop
  801.   arg=UPPER(arg)
  802.   arg=SPACE(STRIP(arg),1,'_')
  803.   IF getinput(1 1 'Really kill' arg'? (nY) > ')='N' THEN
  804.     DO
  805.       arg=''
  806.       ITERATE loop
  807.     END
  808.   SAY 'Working...'
  809.   IF readlines(bbspath'Users/'arg 1) THEN
  810.     DO
  811.       SAY 'User' arg 'not found.'
  812.       arg=''
  813.       ITERATE loop
  814.     END
  815.   IF level<=lynes.20 THEN
  816.     DO
  817.       SAY '*** Tsk! Tsk!  Your level is not greater than' arg'.'
  818.       arg=''
  819.       ITERATE loop
  820.     END
  821.   CALL DELETE(bbspath'Users/'arg)
  822.   IF EXISTS(bbspath'Email/'arg) THEN
  823.     DO
  824.       temp=WORDS(SHOWDIR(bbspath'Email/'arg))
  825.       emailonline=emailonline-temp
  826.       ADDRESS COMMAND 'C:DELETE >*' bbspath'Email/'arg 'ALL'
  827.     END
  828.   IF EXISTS(bbspath'EmailFiles/'arg) THEN
  829.     ADDRESS COMMAND 'C:DELETE >*' bbspath'EmailFiles/'arg 'ALL'
  830.   SAY 'User file, Email & EmailFiles for' arg 'have been deleted.'
  831.   killcount=killcount+1
  832.   arg=''
  833. END
  834. IF killcount=0 THEN RETURN
  835. CALL DELETE(bbspath'Lists/USERS')
  836. sortuserflag=1
  837. RETURN
  838.  
  839.  
  840. menus:
  841. IF menu='NEW' THEN
  842.   DO
  843.     SAY pen6'     _________________'def
  844.     SAY pen6'  __/  'pen3'New User Menu'pen6'  \___'def
  845.     SAY pen6' |                        |'def
  846.     SAY pen6' |'def'   ['pen3'H'def']elp               'pen6'|'def
  847.     SAY pen6' |'def'   ['pen3'I'def']nformation        'pen6'|'def
  848.     SAY pen6' |'def'   ['pen3'Y'def']our user data     'pen6'|'def
  849.     SAY pen6' |'def'   ['pen3'W'def']ho is here        'pen6'|'def
  850.     SAY pen6' |'def'   ['pen3'S'def']earch user list   'pen6'|'def
  851.     SAY pen6' |'def'   ['pen3'V'def']iew user log      'pen6'|'def
  852.     SAY pen6' |'def'   ['pen3'Z'def'] bbs statistics   'pen6'|'def
  853.     SAY pen6' |'def'   ['pen3','def'] hourly stats     'pen6'|'def
  854.     SAY pen6' |'def'   ['pen3'X'def'] toggle menus     'pen6'|'def
  855.     SAY pen6' |'def'   ['pen3'#'def'] toggle color     'pen6'|'def
  856.     SAY pen6' |'def'   ['pen3'!'def'] YELL for SYSOP   'pen6'|'def
  857.     SAY pen6' |'def'   ['pen3'C'def']omment to SYSOP   'pen6'|'def
  858.     SAY pen6' |'def'   ['pen3'G'def']oodbye (hangup)   'pen6'|'def
  859.     SAY pen6' |________________________|'def
  860.   END
  861. ELSE IF menu='MSG' THEN
  862.   DO
  863.     SAY pen6'       ____________'def
  864.     SAY pen6'  ____/  'pen3'Messages'pen6'  \_____'def
  865.     SAY pen6' |                       |'def
  866.     SAY pen6' |'def'   ['pen3'H'def']elp              'pen6'|'def
  867.     SAY pen6' |'def'   ['pen3'P'def']ost messages     'pen6'|'def
  868.     SAY pen6' |'def'   ['pen3'R'def']ead messages     'pen6'|'def
  869.     SAY pen6' |'def'   ['pen3'S'def']earch messages   'pen6'|'def
  870.     SAY pen6' |'def'   ['pen3'E'def']mail (private)   'pen6'|'def
  871.     SAY pen6' |'def'   ['pen3'C'def']omment to SYSOP  'pen6'|'def
  872.     SAY pen6' |'def'   ['pen3'QUICK'def'] options     'pen6'|'def
  873.     SAY pen6' |'def'   ['pen3'FL'def'] Friends List   'pen6'|'def
  874.     SAY pen6' |'def'   ['pen3'!'def'] YELL for SYSOP  'pen6'|'def
  875. IF(level>sysoplevel) THEN DO
  876.     SAY pen6' |'def'   ['pen3'^'def'] view BBS logs   'pen6'|'def
  877.     SAY pen6' |'def'   ['pen3')'def'] email report    'pen6'|'def
  878.     SAY pen6' |'def'   ['pen3'='def'] level report    'pen6'|'def
  879.     SAY pen6' |'def'   ['pen3';'def'] change username 'pen6'|'def;END
  880. IF(level=99) THEN DO
  881.     SAY pen6' |'def'   ['pen3'~'def'] online editor   'pen6'|'def
  882.     SAY pen6' |'def'   ['pen3'@'def'] dos shell       'pen6'|'def;END
  883.     SAY pen6' |'def'   ['pen3'F'def']iles menu        'pen6'|'def
  884.     SAY pen6' |'def'   ['pen3'.'def'] main menu       'pen6'|'def
  885.     SAY pen6' |_______________________|'def
  886.   END
  887. ELSE IF menu='FILE' THEN
  888.   DO
  889.     SAY pen6'         _________'def
  890.     SAY pen6'  ______/  'pen3'Files'pen6'  \_______'def
  891.     SAY pen6' |                        |'def
  892.     SAY pen6' |'def'   ['pen3'A'def']lphabetic list    'pen6'|'def
  893.     SAY pen6' |'def'   ['pen3'H'def']elp               'pen6'|'def
  894.     SAY pen6' |'def'   ['pen3'B'def']rowse filenotes   'pen6'|'def
  895.     SAY pen6' |'def'   ['pen3'N'def']ew files list     'pen6'|'def
  896.     SAY pen6' |'def'   ['pen3'L'def']ist by Library    'pen6'|'def
  897.     SAY pen6' |'def'   ['pen3'F'def']ilelist archives  'pen6'|'def
  898.     SAY pen6' |'def'   ['pen3'S'def']earch files       'pen6'|'def
  899.     SAY pen6' |'def'   ['pen3'U'def']pload             'pen6'|'def
  900.     SAY pen6' |'def'   ['pen3'D'def']ownload           'pen6'|'def
  901.     SAY pen6' |'def'   ['pen3'+'def'] Extra Devices    'pen6'|'def
  902. IF(level>sysoplevel) THEN DO
  903.     SAY pen6' |'def'   ['pen3'K'def']ill a user        'pen6'|'def
  904.     SAY pen6' |'def'   ['pen3'%'def'] edit filenote    'pen6'|'def
  905.     SAY pen6' |'def'   ['pen3'('def'] file report      'pen6'|'def
  906.     SAY pen6' |'def'   ['pen3';'def'] change username  'pen6'|'def;END
  907. IF(level=99) THEN
  908.     SAY pen6' |'def'   ['pen3'@'def'] dos shell        'pen6'|'def
  909.     SAY pen6' |'def'   ['pen3'M'def']essages menu      'pen6'|'def
  910.     SAY pen6' |'def'   ['pen3'.'def'] main menu        'pen6'|'def
  911.     SAY pen6' |________________________|'def
  912.   END
  913. ELSE IF menu='MAIN' THEN
  914.   DO
  915.     SAY pen6'       _____________'def
  916.     SAY pen6'  ____/  'pen3'Main Menu'pen6'  \_____'def
  917.     SAY pen6' |                        |'def
  918.     SAY pen6' |'def'   ['pen3'H'def']elp               'pen6'|'def
  919.     SAY pen6' |'def'   ['pen3'I'def']nfomation         'pen6'|'def
  920.     SAY pen6' |'def'   ['pen3'J'def']ump to doorways   'pen6'|'def
  921.     SAY pen6' |'def'   ['pen3'Y'def']our user data     'pen6'|'def
  922.     SAY pen6' |'def'   ['pen3'W'def']ho is here list   'pen6'|'def
  923.     SAY pen6' |'def'   ['pen3'S'def']earch userlist    'pen6'|'def
  924.     SAY pen6' |'def'   ['pen3'O'def']ther users info   'pen6'|'def
  925.     SAY pen6' |'def'   ['pen3'V'def']iew user log      'pen6'|'def
  926.     SAY pen6' |'def'   ['pen3'X'def']pert (no menus)   'pen6'|'def
  927.     SAY pen6' |'def'   ['pen3'#'def'] toggle colors    'pen6'|'def
  928.     SAY pen6' |'def'   ['pen3'$'def'] toggle menu(s)   'pen6'|'def
  929.     SAY pen6' |'def'   ['pen3'&'def'] user profiles    'pen6'|'def
  930.     SAY pen6' |'def'   ['pen3'Z'def'] bbs statistics   'pen6'|'def
  931.     SAY pen6' |'def'   ['pen3','def'] hourly stats     'pen6'|'def
  932.     SAY pen6' |'def'   ['pen3'G'def']oodbye (hangup)   'pen6'|'def
  933.     SAY pen6' |'def'   ['pen3'F'def']iles menu         'pen6'|'def
  934.     SAY pen6' |'def'   ['pen3'M'def']essages menu      'pen6'|'def
  935.     SAY pen6' |________________________|'def
  936.   END
  937. ELSE IF menu='ALL' THEN
  938.   DO
  939.     SAY pen6'     __________________________________________________________'def
  940.     SAY pen6'  __/   'pen3'Main Menu            File Menu          Message Menu 'pen6'  \__'def
  941.     SAY pen6' |                                                                |'def
  942.     SAY pen6' |'def' ['pen3'H'def']elp               ['pen3'A'def']lphabetical list  ['pen3'P'def']ost messages      'pen6'|'def
  943.     SAY pen6' |'def' ['pen3'I'def']nformation        ['pen3'B'def']rowse filenotes   ['pen3'R'def']ead messages      'pen6'|'def
  944.     SAY pen6' |'def' ['pen3'Z'def'] bbs statiZtics   ['pen3'L'def']ist by Library    ['pen3'E'def']mail (private)    'pen6'|'def
  945.     SAY pen6' |'def' ['pen3'Y'def']our user data     ['pen3'N'def']ew files          ['pen3'C'def']omment to SYSOP   'pen6'|'def
  946.     SAY pen6' |'def' ['pen3'O'def']ther users info   ['pen3'F'def']ilelist archiver  ['pen3'!'def'] YELL for SYSOP   'pen6'|'def
  947.     SAY pen6' |'def' ['pen3'J'def']ump to doorways   ['pen3'+'def'] Extra Devices    ['pen3'X'def']pert (no menus)   'pen6'|'def
  948.     SAY pen6' |'def' ['pen3'S'def']earch menu        ['pen3'D'def']ownload           ['pen3'$'def'] toggle menu(s)   'pen6'|'def
  949.     SAY pen6' |'def' ['pen3'&'def'] user profiles    ['pen3'U'def']pload             ['pen3'#'def'] toggle colors    'pen6'|'def
  950.     SAY pen6' |'def' ['pen3'V'def']iew user log      ['pen3'T'def']ransfer protocol  ['pen3','def'] hourly stats     'pen6'|'def
  951.     SAY pen6' |'def' ['pen3'G'def']oodbye (logoff)   ['pen3'QUICK'def'] options      ['pen3'FL'def'] Friends List    'pen6'|'def
  952. IF(level>sysoplevel) THEN DO
  953.     SAY pen6' |'def' ['pen3'K'def']ill a user        ['pen3'%'def'] edit filenote    ['pen3'='def'] level report     'pen6'|'def
  954.     SAY pen6' |'def' ['pen3'^'def'] view BBS logs    ['pen3'('def'] file report      ['pen3';'def'] change username  'pen6'|'def;END
  955. IF(level=99) THEN
  956.     SAY pen6' |'def' ['pen3'~'def'] online editor    ['pen3'@'def'] dos shell        ['pen3')'def'] email report     'pen6'|'def
  957.     SAY pen6' |________________________________________________________________|'def
  958.   END
  959. SAY
  960. RETURN
  961.  
  962.  
  963. help:
  964. ARG helppath .
  965. SAY
  966. SAY 'For more detailed help, use ['pen3'I'def']nformation commmand to read BBBBS.COMMANDS.'
  967. IF helppath='MAIN' THEN
  968.   SAY 'Commands available from the' pen3||menu||def 'menu:'
  969. frontend=bbspath'BBS_HELP/'helppath
  970. backend='.USER'
  971. IF level=0 THEN backend='.NEW'
  972. ELSE IF level=99 THEN backend='.SUPER'
  973. ELSE IF level>sysoplevel THEN backend='.SYSOP'
  974. CALL showtext(frontend||backend)
  975. RETURN
  976.  
  977.  
  978. waiting:
  979. IF waitchar='Q' THEN
  980.   DO
  981.     waitchar=''
  982.     RETURN
  983.   END
  984. waitchar=''
  985. IF nonstop=1 THEN RETURN
  986. OPTIONS PROMPT pen3'                       RETURN=Continue  'def
  987. PULL waitchar
  988. CALL cleanline(1)
  989. RETURN
  990.  
  991.  
  992. waiting2:
  993. IF nonstop=1 THEN RETURN 0
  994. waitchar=getinput(1 1 pen3'   Q=Quit   N=Non-Stop   RETURN=Continue  'def)
  995. IF waitchar='N' THEN
  996.   DO
  997.     nonstop=1
  998.     SAY pen3'To EXIT non-stop scrolling of text, press CTRL-E        'def
  999.     SAY
  1000.     CALL DELAY(100)
  1001.     waitchar=''
  1002.   END
  1003. CALL cleanline(1)
  1004. IF waitchar='Q' THEN RETURN 1
  1005. RETURN 0
  1006.  
  1007.  
  1008. busywait:
  1009. ARG bii bi bt 
  1010. IF bbsprefs.21=0 THEN RETURN
  1011. IF bi<1 THEN
  1012.   DO
  1013.     CALL WRITECH(STDOUT,'080808'x)
  1014.     IF ni<1 & i>999998 & wi>999998 THEN SAY
  1015.     RETURN
  1016.   END
  1017. IF bi=1 THEN CALL WRITECH(STDOUT,'   ')
  1018. IF bi//(bii%2)~=0 THEN RETURN
  1019. b=bi//bii
  1020. IF b=0 | b=bii%2 THEN
  1021.   DO
  1022.     tp=RIGHT((bi*100)%bt,2)'%'
  1023.     CALL WRITECH(STDOUT,'080808'x||tp)
  1024.   END
  1025. RETURN
  1026.  
  1027.  
  1028. cleanline:
  1029. ARG lflag .
  1030. IF nonstop=0 & clr~='' THEN
  1031.   DO
  1032.     SAY clr
  1033.     RETURN
  1034.   END
  1035. IF colorflag~=1 & lflag=1 THEN RETURN
  1036. cline=lineup||LEFT(' ',77)
  1037. IF lflag=1 THEN cline=cline||lineup
  1038. SAY cline
  1039. RETURN
  1040.  
  1041.  
  1042. getinput:
  1043. PARSE ARG upflag' 'oneflag' 'pline
  1044. OPTIONS PROMPT pline
  1045. PARSE PULL inarg
  1046. inarg=STRIP(inarg)
  1047. IF upflag THEN inarg=UPPER(inarg)
  1048. IF oneflag THEN inarg=LEFT(inarg,1)
  1049. RETURN inarg
  1050.  
  1051.  
  1052. docity:
  1053. PARSE ARG citi
  1054. citi=TRANSLATE(citi,'          ','+-.,*/()<>')
  1055. DO i=WORDS(citi) TO 1 BY -1
  1056.   IF DATATYPE(WORD(citi,i),'N') THEN citi=STRIP(DELWORD(citi,i,1))
  1057.   IF UPPER(WORD(citi,i))='USA' THEN citi=STRIP(DELWORD(citi,i,1))
  1058. END
  1059. citi=SPACE(citi,1)
  1060. RETURN STRIP(citi)
  1061.  
  1062.  
  1063. setdir:
  1064. PARSE ARG tempdir
  1065. CALL PRAGMA('D',STRIP(tempdir))
  1066. directory=PRAGMA('D')
  1067. slash=LASTPOS('/',directory)
  1068. IF slash=0 THEN slash=LASTPOS(':',directory)
  1069. plaindir=directory
  1070. IF slash>0 THEN plaindir=SUBSTR(plaindir,slash+1)
  1071. RETURN
  1072.  
  1073.  
  1074. config:
  1075. arg='s:CONFIG.BBS'
  1076. IF ~EXISTS(arg) THEN arg='BBS:BBS_TEXT/CONFIG.BBS'
  1077. IF readlines(arg 1) THEN
  1078.   DO
  1079.     SAY 's:CONFIG.BBS and BBS:BBS_TEXT/CONFIG.BBS are both missing!'
  1080.     SIGNAL DONE2
  1081.   END
  1082. compos=POS('/*',lynes.1)
  1083. IF compos>0 THEN lynes.1=LEFT(lynes.1,compos-1)
  1084. bbsname=STRIP(lynes.1)
  1085. sysop=WORD(lynes.2,1)
  1086. compos=POS('/*',lynes.3)
  1087. IF compos>0 THEN lynes.3=LEFT(lynes.3,compos-1)
  1088. exclusion=STRIP(lynes.3)
  1089. bbsdevice=WORD(lynes.4,1)
  1090. sysoplevel=WORD(lynes.5,1)
  1091. bbspath=WORD(lynes.6,1)
  1092. IF ~EXISTS(bbspath) THEN
  1093.   DO
  1094.     SAY bbspath 'does not exist!'
  1095.     SIGNAL DONE2
  1096.   END
  1097. testchar=RIGHT(bbspath,1)
  1098. IF testchar~='/' & testchar~=':' THEN bbspath=bbspath'/'
  1099. CALL SETCLIP('BBS_path',bbspath)
  1100. msgpath=WORD(lynes.7,1)
  1101. IF ~EXISTS(msgpath) THEN
  1102.   DO
  1103.     SAY msgpath 'does not exist!'
  1104.     SIGNAL DONE2
  1105.   END
  1106. testchar=RIGHT(msgpath,1)
  1107. IF testchar~='/' & testchar~=':' THEN msgpath=msgpath'/'
  1108. CALL SETCLIP('BBS_msgpath',msgpath)
  1109. msgpath=msgpath'MSG'
  1110. libpath=WORD(lynes.8,1)
  1111. IF ~EXISTS(libpath) THEN
  1112.   DO
  1113.     SAY libpath 'does not exist!'
  1114.     SIGNAL DONE2
  1115.   END
  1116. testchar=RIGHT(libpath,1)
  1117. IF testchar~='/' & testchar~=':' THEN libpath=libpath'/'
  1118. CALL SETCLIP('BBS_libpath',libpath)
  1119. extdevs=''
  1120. DO i=1 TO WORDS(lynes.10)
  1121.   test=WORD(lynes.10,i)
  1122.   IF POS(':',test)=0 THEN ITERATE i
  1123.   IF LEFT(test,2)='/*' THEN LEAVE i
  1124.   extdevs=STRIP(extdevs test)
  1125. END
  1126. SYSTEM_MSG_LIMIT=WORD(lynes.11,1)
  1127. SYSTEM_SPACE_LIMIT=WORD(lynes.12,1)
  1128. maxidle=WORD(lynes.13,1)
  1129. maxtime=WORD(lynes.14,1)
  1130. maxbps=WORD(lynes.15,1)
  1131. IF ~DATATYPE(maxbps,'W') THEN maxbps=2400
  1132. CALL SETCLIP('BBS_baud',maxbps)
  1133. DO i=16 TO 40
  1134.   j=i-15
  1135.   bbsprefs.j=STRIP(WORD(lynes.i,1))
  1136. END
  1137. spellpath=WORD(lynes.9,1)
  1138. IF bbsprefs.5 & ~EXISTS(spellpath) THEN
  1139.   DO
  1140.     SAY spellpath 'does not exist!'
  1141.     bbsprefs.5=0
  1142.   END
  1143. IF bbsprefs.10 THEN scratch=bbspath'Scratch'
  1144. ELSE scratch='RAM:Scratch'
  1145. CALL MAKEDIR(scratch)
  1146. IF ~DATATYPE(bbsprefs.16,'W') THEN bbsprefs.16=3
  1147. extension=WORD(lynes.32,1)
  1148. arccom=lynes.33
  1149. compos=POS('/*',lynes.33)
  1150. IF compos>0 THEN lynes.33=LEFT(lynes.33,compos-1)
  1151. arccom=STRIP(lynes.33)
  1152. IF LEFT(extension,1)~='.' THEN
  1153.   DO
  1154.     extension='.lzh'
  1155.     arccom='lharc -m m'
  1156.   END
  1157. RETURN
  1158.  
  1159.  
  1160. readlogs:
  1161. IF arg='' THEN
  1162.   arg=getinput(1 0 '['pen3'RETURN'def']=TODAY, or enter Log Date ('pen3||DATE('S')||def') > ')
  1163. IF arg='' THEN arg=DATE('S')
  1164. arg=bbspath'Logs/log.'arg
  1165. CALL readlines(arg 1)
  1166. CALL seelines(0)
  1167. nonstop=0
  1168. CALL waiting()
  1169. RETURN
  1170.  
  1171.  
  1172. loadcourtesy:
  1173. IF courtesyflag=0 & courtesy='' & EXISTS(bbspath'Lists/Courtesy') THEN
  1174.   DO
  1175.     IF readopen(bbspath'Lists/Courtesy') THEN
  1176.       DO
  1177.         SAY 'Checking Courtesy List...'
  1178.         DO i=1
  1179.           line=READLN(f)
  1180.           IF EOF(f) THEN BREAK
  1181.           courtesy=courtesy UPPER(line)
  1182.         END
  1183.         CALL CLOSE(f)
  1184.         MSG ''
  1185.         MSG pen3'Courtesy List:'def
  1186.         MSG courtesy
  1187.       END
  1188.   END
  1189. RETURN
  1190.  
  1191.  
  1192. fileheader:
  1193. SAY 'Filename          Bytes File# Library         KeyWords'
  1194. SAY pen3||LEFT('=',77,'=')||def
  1195. RETURN
  1196.  
  1197.  
  1198. showalpha:
  1199. IF DATATYPE(arg,'W') THEN
  1200.   DO
  1201.     dirnum=arg
  1202.     arg=''
  1203.     IF chdir2()>0 THEN RETURN
  1204.     test='Y'
  1205.   END
  1206. ELSE
  1207.   DO
  1208.     test=getinput(1 1 'Show one library only? (Ny) > ')
  1209.     IF test='Y' THEN
  1210.       IF chdir()>0 THEN RETURN
  1211.   END
  1212.  
  1213. showalpha2:
  1214. IF test='Y' THEN filecount=WORDS(SHOWDIR(bbspath'FileNotes/'plaindir))
  1215. ELSE filecount=files.0
  1216. SAY '  'filecount 'files.'
  1217. CALL fileheader()
  1218. count=0
  1219. DO wi=1 TO alpha.0
  1220.   CALL busywait(60 wi alpha.0)
  1221.   IF test='Y' THEN
  1222.     DO
  1223.       IF count>=filecount THEN LEAVE wi
  1224.       IF UPPER(LEFT(plaindir,12))~=UPPER(LEFT(WORD(alpha.wi,5),12)) THEN
  1225.         ITERATE wi
  1226.     END
  1227.   jj=WORD(alpha.wi,4)
  1228.   IF jj>level | FIND(data.21,UPPER(dirs.jj))>0 THEN
  1229.     ITERATE wi
  1230.   CALL busywait(4 0)
  1231.   SAY LEFT(alpha.wi,76)
  1232.   count=count+1
  1233.   IF (count+2)//linesperpage=0 THEN
  1234.     IF waiting2() THEN
  1235.       DO
  1236.         CALL busywait(4 1)
  1237.         LEAVE wi
  1238.       END
  1239.   CALL busywait(4 1)
  1240. END
  1241. CALL busywait(4 0)
  1242. nonstop=0
  1243. IF waitchar~='Q' THEN CALL waiting()
  1244. RETURN
  1245.  
  1246.  
  1247. profiles:
  1248. prodir=bbspath'Profiles'
  1249. CALL MAKEDIR(prodir)
  1250. pros=SHOWDIR(prodir)
  1251. protxt=bbspath'BBS_TEXT/PROFILES'
  1252. IF EXISTS(protxt) THEN CALL showtext(protxt)
  1253. DO lupe=1
  1254.   SAY
  1255.   SAY '       1. Edit 'name'''s user Profile'
  1256.   SAY '       2. View a User Profile'
  1257.   SAY '       3. Search User Profiles'
  1258.   SAY '       4. Browse User Profiles'
  1259.   SAY
  1260.   temp=getinput(1 1 'Enter Selection Number > ')
  1261.   IF temp=1 THEN
  1262.     DO
  1263.       lynes.=''
  1264.       IF EXISTS(prodir'/'name) THEN
  1265.         DO
  1266.           IF readlines(prodir'/'name 1)~=0 THEN ITERATE lupe
  1267.           CALL DELETE(prodir'/'name)
  1268.         END
  1269.       ELSE lynes.0=3
  1270.       lynes.1=name
  1271.       lynes.2='Profile Last Updated:' DATE('W') DATE() TIME('C')
  1272.       lynes.3=LEFT('=',74,'=')
  1273.       IF savelines(prodir'/'name)~=0 THEN
  1274.         DO
  1275.           line='Profile for' name 'failed to save!'
  1276.           SAY line
  1277.           CALL send2log(line)
  1278.           ITERATE lupe
  1279.         END
  1280.       edtype=''
  1281.       CALL bbsEd(4 prodir'/'name)
  1282.       IF readlines(prodir'/'name 1)~=0 THEN CALL DELETE(prodir'/'name)
  1283.       IF lynes.0<4 THEN CALL DELETE(prodir'/'name)
  1284.       pros=SHOWDIR(prodir)
  1285.     END
  1286.   ELSE IF temp=2 THEN
  1287.     DO pf=1
  1288.       totpros=WORDS(pros)
  1289.       DO pfl=1 TO totpros BY 3
  1290.         pfl2=pfl+1
  1291.         pfl3=pfl+2
  1292.         pfline=pen3||RIGHT(pfl,3)||def LEFT(WORD(pros,pfl),21)
  1293.         IF pfl2<=totpros THEN
  1294.           pfline=pfline pen3||RIGHT(pfl2,3)||def LEFT(WORD(pros,pfl2),21)
  1295.         IF pfl3<=totpros THEN
  1296.           pfline=pfline pen3||RIGHT(pfl3,3)||def LEFT(WORD(pros,pfl3),21)
  1297.         SAY pfline
  1298.         IF nonstop~=1 & ((pfl3%3)//linesperpage)=0 THEN
  1299.           IF waiting(2) THEN LEAVE pfl
  1300.       END
  1301.       emnum=getinput(1 0 pen3'Select User Profile Number > 'def)
  1302.       IF DATATYPE(emnum,'W') & emnum>0 & emnum<=totpros THEN
  1303.         DO
  1304.           tmp=WORD(pros,emnum)
  1305.           IF level>sysoplevel THEN
  1306.             DO
  1307.               CALL bbsEd(1 prodir'/'tmp)
  1308.               IF readlines(prodir'/'tmp 1)~=0 THEN CALL DELETE(prodir'/'tmp)
  1309.               IF lynes.0<4 THEN CALL DELETE(prodir'/'tmp)
  1310.               pros=SHOWDIR(prodir)
  1311.             END
  1312.           ELSE CALL showtext(prodir'/'tmp)
  1313.         END
  1314.       ELSE LEAVE pf
  1315.     END
  1316.   ELSE IF temp=3 | temp=4 THEN
  1317.     DO
  1318.       searcharg=''
  1319.       nonstop=0
  1320.       IF temp=3 THEN
  1321.         DO
  1322.           searcharg=STRIP(getinput(0 0 'Enter Search Phrase > '))
  1323.           IF searcharg='' THEN ITERATE lupe
  1324.         END
  1325.       DO ui=1 TO WORDS(pros)
  1326.         pro=prodir'/'WORD(pros,ui)
  1327.         IF temp=3 THEN
  1328.           IF textsearch(pro searcharg)=0 THEN ITERATE ui
  1329.         SAY
  1330.         CALL readlines(pro 1)
  1331.         IF nonstop=1 THEN rnonstop=1
  1332.         ELSE rnonstop=0
  1333.         CALL seelines(2)
  1334.         IF rnonstop THEN nonstop=1
  1335.         ELSE IF waiting2()=1 THEN LEAVE ui
  1336.         SAY
  1337.         SAY
  1338.       END
  1339.     END
  1340.   ELSE IF temp='' | LEFT(temp,1)='Q' THEN LEAVE lupe
  1341. END
  1342. DROP pros
  1343. RETURN
  1344.  
  1345.  
  1346. otheruser:
  1347. line=''
  1348. IF level>sysoplevel THEN line='['pen3'R'def']eport or'
  1349. line=line '['pen3'D'def']etails or simple ['pen3'N'def']amelist?'
  1350. IF level>sysoplevel THEN line=line '(Dnr) > '
  1351. ELSE line=line '(Dn) > '
  1352. temp=getinput(1 1 line)
  1353. IF temp='N' THEN
  1354.   DO
  1355.     CALL showuserlist()
  1356.     RETURN
  1357.   END
  1358. ELSE IF level>sysoplevel & temp='R' THEN
  1359.   DO
  1360.     SAY
  1361.     line=''
  1362.     IF getinput(1 1 'Report on inactive users? (nY) > ')~='N' THEN
  1363.       DO
  1364.         CALL cleanline(0)
  1365.         SAY 'INACTIVE_USERS report will be in your email.'
  1366.         line='USERS '
  1367.       END
  1368.     IF getinput(1 1 'Report on actual files vs. filelists? (nY) > ')~='N' THEN
  1369.       DO
  1370.         CALL cleanline(0)
  1371.         line=line'FILES'
  1372.         line=STRIP(line getinput(1 0 'Report only files larger than (0) bytes > '))
  1373.         SAY 'FILELISTS_REPORT will be in your email.'
  1374.       END
  1375.     SAY
  1376.     ADDRESS AREXX bbsREPORT.rexx name line 
  1377.     RETURN
  1378.   END
  1379. SAY
  1380. SAY 'To allow (or not) other users to see your street address and/or phone number,'
  1381. SAY 'add (or delete) STREET and/or PHONE to the line 8 list in ['pen3'Y'def']our userfile.'
  1382. SAY
  1383. SAY 'User specification may include ? wildcard for single characters.'
  1384. SAY 'ie,' pen3's?n'def 'will return all user names containing ''son'', ''sen'', ''sin'', etc.'
  1385. IF arg='' THEN arg=getinput(1 0 pen3'User specification: 'def)
  1386. IF arg='' THEN RETURN
  1387. arg=TRANSLATE(STRIP(arg),'_',' ')
  1388. CALL FileList(bbspath'Users/*'arg'*',wildlist)
  1389. line='Found' wildlist.0 'match'
  1390. IF wildlist.0~=1 THEN line=line'es'
  1391. SAY line'.'
  1392. IF wildlist.0<1 THEN RETURN
  1393. totlines=0
  1394. nextpagebreak=linesperpage-3
  1395. extrainfo=0
  1396. IF level>sysoplevel THEN
  1397.   DO
  1398.     IF getinput(1 1 'Display -sysop only- information? (nY) > ')~='N' THEN
  1399.       extrainfo=1
  1400.   END
  1401. DO i=1 TO wildlist.0
  1402.   CALL readlines(wildlist.i 1)
  1403.   SAY 
  1404.   totlines=totlines+6
  1405.   SAY bak2' 'SUBSTR(wildlist.i,LASTPOS('/',wildlist.i)+1)' 'def
  1406.   SAY lynes.1
  1407.   IF FIND(UPPER(lynes.8),'STREET')>0 THEN
  1408.     DO
  1409.       totlines=totlines+1
  1410.       SAY lynes.2
  1411.     END
  1412.   SAY lynes.3
  1413.   IF FIND(UPPER(lynes.8),'PHONE')>0 THEN
  1414.     DO
  1415.       totlines=totlines+1
  1416.       SAY lynes.4
  1417.     END
  1418.   SAY 'Last time on' bbsname':' DATE(,WORD(lynes.13,1),'S') WORD(lynes.13,2)
  1419.   SAY pen3'Interests:'def lynes.10
  1420.   IF extrainfo THEN
  1421.     DO
  1422.       SAY pen3'   up:'def lynes.14
  1423.       SAY pen3' down:'def lynes.15
  1424.       temptot=0
  1425.       DO j=1 TO WORDS(lynes.23)
  1426.         IF DATATYPE(WORD(lynes.23,j),'W') THEN temptot=temptot+WORD(lynes.23,j)
  1427.       END
  1428.       SAY pen3' writ:'def temptot 'public messages.'
  1429.       SAY pen3'level:'def lynes.20
  1430.       totlines=totlines+4
  1431.       IF lynes.21~='' THEN
  1432.         DO
  1433.           totlines=totlines+1
  1434.           SAY pen3'excluded dirs:'def lynes.21
  1435.         END
  1436.     END
  1437.   IF nonstop~=1 & totlines>=nextpagebreak THEN
  1438.     DO
  1439.       IF waiting2() THEN LEAVE i
  1440.       nextpagebreak=totlines+linesperpage-5
  1441.     END
  1442. END
  1443. nonstop=0
  1444. DROP wildlist.
  1445. IF waitchar~='Q' THEN CALL waiting()
  1446. RETURN
  1447.  
  1448.  
  1449. changename:
  1450. ARG cname
  1451. IF level<=sysoplevel THEN RETURN
  1452. IF cname='' THEN cname=getinput(1 0 'Current Username (include underscore): ')
  1453. IF readlines(bbspath'Users/'cname 1)>0 THEN RETURN
  1454. IF WORD(lynes,20)>=level THEN RETURN
  1455. CALL SETCLIP('BBS_oldname',cname)
  1456. CALL ChangeUserName.rexx()
  1457. cname=GETCLIP('BBS_newname')
  1458. CALL DELETE(bbspath'Lists/USERS')
  1459. sortuserflag=1
  1460. CALL SETCLIP('BBS_oldname')
  1461. CALL SETCLIP('BBS_newname')
  1462. RETURN cname
  1463.  
  1464.  
  1465. levelreport:
  1466. minlev=0
  1467. maxlev=99
  1468. templist=''
  1469. uname=''
  1470. newufile=bbspath'Lists/NEW_USERS'
  1471. IF EXISTS(newufile) THEN
  1472.   DO
  1473.     IF getinput(1 1 'Latest New Users Only? (nY) > ')~='N' THEN
  1474.       DO
  1475.         IF readlines(newufile 1)=0 THEN
  1476.           DO i=2 TO lynes.0
  1477.             templist=STRIP(templist WORD(lynes.i,3))
  1478.           END
  1479.       END
  1480.     ELSE newufile=''
  1481.   END
  1482. ELSE newufile=''
  1483. IF newufile='' THEN
  1484.   DO
  1485.     minlev=getinput(1 0 'Minimum level? (0) > ')
  1486.     maxlev=getinput(1 0 'Maximum level? (99) > ')
  1487.     IF ~DATATYPE(minlev,'W') THEN minlev=0
  1488.     IF ~DATATYPE(maxlev,'W') THEN maxlev=99
  1489.     IF minlev<0 | minlev>99 THEN minlev=0
  1490.     IF maxlev<0 | maxlev>99 THEN maxlev=99
  1491.     templist=userlist
  1492.   END
  1493. DO levi=1 TO WORDS(templist)
  1494.   arg=bbspath'Users/'WORD(templist,levi)
  1495.   CALL readlines(arg 1)
  1496.   lt=WORD(lynes.20,1)
  1497.   IF ~DATATYPE(lt,'W') THEN lt=0
  1498.   IF lt<minlev | lt>maxlev THEN ITERATE levi
  1499.   line=lt WORD(templist,levi)
  1500.   SAY line
  1501.   IF newufile~='' | lt<10 THEN
  1502.     DO
  1503.       SAY line
  1504.       DO levj=1 TO 12
  1505.         SAY pen3'  'lynes.levj||def
  1506.       END
  1507.       SAY pen3'  'lynes.19||def
  1508.     END
  1509.   ELSE ITERATE levi
  1510.   lcom=''
  1511.   IF lt<10 THEN lcom='['pen3'A'def']dd or '
  1512.   lcom=lcom'['pen3'K'def']ill or ['pen3'R'def']ename or ['pen3'S'def']kip this user?'
  1513.   IF lt<10 THEN lcom=lcom' (Akrs) > '
  1514.   ELSE lcom=lcom '(krS) > '
  1515.   lcom=getinput(1 1 lcom)
  1516.   CALL cleanline(0)
  1517.   IF lcom='K' THEN
  1518.     DO
  1519.       arg=WORD(templist,levi)
  1520.       CALL killuser()
  1521.     END
  1522.   ELSE IF lcom='R' THEN
  1523.     DO
  1524.       newname=changename(WORD(templist,levi))
  1525.       IF newname~='' & newname~=WORD(templist,levi) THEN
  1526.         DO
  1527.           temp=WORDINDEX(templist,levi+1)
  1528.           rtemp=''
  1529.           IF temp>0 THEN rtemp=SUBSTR(templist,temp)
  1530.           temp=WORDINDEX(templist,levi)
  1531.           templist=''
  1532.           IF temp>2 THEN templist=STRIP(LEFT(templist,temp-1))
  1533.           templist=STRIP(templist newname rtemp)
  1534.           userlist=userlist newname
  1535.         END
  1536.       levi=levi-1
  1537.       CALL SETCLIP('BBS_newname')
  1538.     END
  1539.   ELSE IF lcom~='S' & lt<10 THEN
  1540.     DO
  1541.       IF readopen(bbspath'BBS_TEXT/DEF.MEMBER') THEN
  1542.         DO
  1543.           DO lvi=1 TO 22
  1544.             line=READLN(f)
  1545.             IF lvi=11 THEN lynes.11=line
  1546.             IF lvi=20 THEN lynes.20=line
  1547.             IF lvi=21 THEN lynes.21=line
  1548.           END
  1549.           lynes.22=line
  1550.           CALL CLOSE(f)
  1551.           edtype=''
  1552.           IF bbsprefs.25=1 THEN
  1553.             DO
  1554.               SAY
  1555.               IF DATATYPE(lynes.20,'W') THEN
  1556.                 DO
  1557.                   lynes.22=''
  1558.                   lynes.23=''
  1559.                   SAY 'Setting message counters to last 10 messages in each conference...'
  1560.                   DO i=1 TO lynes.20
  1561.                     num=countcheck(bbspath'Numbers/LastMessage'i 0)-10
  1562.                     IF num<0 | msg.i.0<10 THEN num=0
  1563.                     lynes.22=lynes.22 num
  1564.                     lynes.23=lynes.23 0
  1565.                   END
  1566.                 END
  1567.               ELSE SAY 'Bad default level in BBS_TEXT/DEF.MEMBER file!'
  1568.               SAY 'Setting file counter to last file uploaded...'
  1569.               lynes.16=countcheck(bbspath'Numbers/LastFile' 0)
  1570.               lynes.16=lynes.16 '19900101 00:00:00'
  1571.             END
  1572.           lynes.0=27
  1573.           CALL savelines(arg)
  1574.           SAY lynes.20 WORD(templist,levi) 'has been made a member.'
  1575.         END
  1576.       ELSE SAY 'You need a default member file in BBS_TEXT!  ( BBS_TEXT/DEF.MEMBER )'
  1577.     END
  1578.   IF lcom~='K' & lcom~='R' & newufile~='' THEN
  1579.     DO
  1580.       nlt=getinput(1 0 lynes.20 'Enter new level or blank for no change. > ')
  1581.       IF DATATYPE(nlt,'W') THEN
  1582.         DO
  1583.           lynes.20=nlt
  1584.           edtype=''
  1585.           CALL savelines(arg)
  1586.         END
  1587.       CALL writenew()
  1588.     END
  1589. END
  1590. IF newufile~='' & EXISTS(newufile) THEN
  1591.   IF getinput(1 1 'Delete NEW_USERS file? (nY) > ')~='N' THEN CALL DELETE(newufile)
  1592. IF EXISTS(bbspath'Lists/CBV_USERS') THEN
  1593.   IF getinput(1 1 'Delete CBV_USERS file? (nY) > ')~='N' THEN
  1594.     CALL DELETE(bbspath'Lists/CBV_USERS')
  1595. DROP templist
  1596. RETURN
  1597.  
  1598.  
  1599. writenew:
  1600. arg=WORD(templist,levi)
  1601. IF getinput(1 1 'Write' arg 'an email message? (nY) > ')~='N' THEN
  1602.   DO
  1603.     IF EXISTS(bbspath'BBS_TEXT/EMAIL_WELCOME') THEN
  1604.       IF getinput(1 1 'Use default welcome? (nY) > ')~='N' THEN replysubj='|@NEW@|'
  1605.     CALL editor('MAIL' arg)
  1606.   END
  1607. RETURN
  1608.  
  1609.  
  1610. filereport:
  1611. SAY 'Searching for mismatches between files and filenotes...'
  1612. DO i=1 TO sysoplevel+1
  1613.   IF dirs.i='' THEN ITERATE
  1614.   SAY dirs.i'                               'lineup
  1615.   rfiles=SHOWDIR(libpath||dirs.i)
  1616.   rnotes=SHOWDIR(bbspath'FileNotes/'dirs.i)
  1617.   IF WORDS(rfiles)~=WORDS(rnotes) THEN
  1618.     DO
  1619.       line='Compare files & filenotes in'pen3 dirs.i||def'. '
  1620.       DO j=1 TO WORDS(rfiles)
  1621.         IF FIND(UPPER(rnotes),UPPER(WORD(rfiles,j)))=0 THEN
  1622.           line=line WORD(rfiles,j)
  1623.       END
  1624.       SAY line
  1625.     END
  1626. END
  1627. SAY '07'x
  1628. CALL waiting()
  1629. RETURN
  1630.  
  1631.  
  1632. mailreport:
  1633. SAY 'Checking ALL pending Email...'
  1634. SAY pen3' - Use CTRL-E to Exit -'def
  1635. SAY
  1636. mailrep=SHOWDIR(bbspath'Email','D')
  1637. mailfil=SHOWDIR(bbspath'EmailFiles','D')
  1638. lastemail=WORD(data.17,3)
  1639. IF ~DATATYPE(lastemail,'W') THEN lastemail=0
  1640. IF lastemail=countcheck(bbspath'Numbers/LastMail' 0) THEN
  1641.   DO
  1642.     DROP mailrep. mailfil.
  1643.     RETURN
  1644.   END
  1645. mailynes.=''
  1646. mk=0
  1647. DO mi=1 TO WORDS(mailrep)
  1648.   muser=WORD(mailrep,mi)
  1649.   IF muser=sysop | muser=name THEN ITERATE mi
  1650.   mlist=SHOWDIR(bbspath'Email/'muser)
  1651.   IF WORDS(mlist)>0 THEN SAY lineup||RIGHT(muser,40)
  1652.   DO mj=1 TO WORDS(mlist)
  1653.     fuser=WORD(mlist,mj)
  1654.     IF POS(sysop,fuser)>0 THEN ITERATE mj
  1655.     IF logonflag=0 THEN
  1656.       DO
  1657.         mk=mk+1
  1658.         mailynes.mk=pen3||LEFT(muser,20) 'from'def LEFT(fuser,20) DATE(,WORD(STATEF(bbspath'Email/'muser'/'fuser),5),'I')
  1659.       END
  1660.     IF POS(sysop,fuser)=0 & POS(name,fuser)=0 THEN
  1661.       DO
  1662.         testnum=RIGHT(fuser,LENGTH(fuser)-LASTPOS('.',fuser))
  1663.         IF testnum>emailnum THEN emailnum=testnum
  1664.         IF testnum>lastemail THEN
  1665.           DO
  1666.             CALL showtext(bbspath'Email/'muser'/'fuser)
  1667.             SAY
  1668.             SAY
  1669.             IF waitchar='Q' THEN LEAVE mi
  1670.           END
  1671.       END
  1672.   END
  1673.   IF logonflag=0 & FIND(mailfil,muser)>0 THEN
  1674.     DO
  1675.       efilelist=SHOWDIR(bbspath'EmailFiles/'muser)
  1676.       IF WORDS(efilelist)>0 THEN
  1677.         DO
  1678.           mk=mk+1
  1679.           mailynes.mk=pen3||LEFT(muser,20) 'emailfiles'def efilelist
  1680.         END
  1681.     END
  1682. END
  1683. data.17=WORD(data.17,1) WORD(data.17,2) countcheck(bbspath'Numbers/LastMail' 0)
  1684. IF mk>0 THEN
  1685.   DO
  1686.     lynes.0=mk
  1687.     DO mi=1 TO mk
  1688.       lynes.mi=mailynes.mi
  1689.     END
  1690.     CALL seelines(1)
  1691.     nonstop=0
  1692.     CALL waiting()
  1693.   END
  1694. ELSE SAY 'No unseen Email pending.'
  1695. DROP mailrep. mailfil. mailynes. mlist
  1696. RETURN
  1697.  
  1698.  
  1699. sortdoors:
  1700. IF ~DATATYPE(jdoors.0,'W') THEN doors.0=0
  1701. IF WORDS(SHOWDIR(bbspath'rexxDoors','F'))~=doors.0 THEN
  1702.   DO
  1703.     jdoors.=''
  1704.     doorlist=SHOWDIR(bbspath'rexxDoors','F')
  1705.     doors.=''
  1706.     doors.0=WORDS(doorlist)
  1707.     DO i=1 TO doors.0
  1708.       doors.i=WORD(doorlist,i)
  1709.     END
  1710.     SAY 'Sorting..'lineup
  1711.     IF doors.0>0 THEN CALL QSORT(1,doors.0,doors)
  1712.     jdoors.0=doors.0%3
  1713.     IF (doors.0//3)>0 THEN jdoors.0=jdoors.0+1
  1714.     DO i=1 TO jdoors.0
  1715.       DO j=0 TO 2
  1716.         k=i+j*jdoors.0
  1717.         IF k<=doors.0 THEN
  1718.           DO
  1719.             jdoors.i=jdoors.i' 'LEFT(RIGHT(k,3)'.' LEFT(doors.k,LENGTH(doors.k)-5),24)
  1720.             dcount=WORD(STATEF(bbspath'rexxDoors/'doors.k),8)
  1721.             jdoors.i.0=jdoors.i.0||LEFT(RIGHT(dcount,5) LEFT(doors.k,LENGTH(doors.k)-5),24)' '
  1722.           END
  1723.       END
  1724.     END
  1725.   END
  1726. RETURN 0
  1727.  
  1728.  
  1729. jump2rexx:
  1730. CALL sortdoors()
  1731. temp=1
  1732. readcount=-1
  1733. DO doorloop=1
  1734.   IF temp=0 THEN
  1735.     DO
  1736.       IF readcount~=-1 THEN
  1737.         DO
  1738.           doors.0=''
  1739.           CALL sortdoors()
  1740.         END
  1741.       SAY CENTER('- Number of accesses per file -',75)
  1742.     END
  1743.   SAY pen3||LEFT('-',75,'-')||def
  1744.   DO jd=1 TO jdoors.0
  1745.     IF temp=0 THEN SAY jdoors.jd.0
  1746.     ELSE SAY jdoors.jd
  1747.     IF jd//linesperpage=0 THEN CALL waiting()
  1748.     IF waitchar='Q' THEN LEAVE doorloop
  1749.   END
  1750.   IF temp=0 THEN
  1751.     DO
  1752.       CALL waiting()
  1753.       temp=1
  1754.       ITERATE doorloop
  1755.     END
  1756.   temp=getinput(1 0 pen3'Select Application Number. 0=Stats > 'def)
  1757.   IF temp=0 THEN ITERATE doorloop
  1758.   IF ~DATATYPE(temp,'W') | temp<1 | temp>doors.0 THEN LEAVE doorloop
  1759.   arg=doors.temp
  1760.   IF GETCLIP('BBS_door')=arg THEN
  1761.     DO
  1762.       SAY 'That door is in use!'
  1763.       ITERATE doorloop
  1764.     END
  1765.   CALL SETCLIP('BBS_localdoor',arg)
  1766.   readcount=WORD(STATEF(bbspath'rexxDoors/'arg),8)
  1767.   IF ~DATATYPE(readcount,'W') THEN readcount=0
  1768.   ADDRESS COMMAND 'C:filenote' bbspath'rexxDoors/'arg readcount+1
  1769.   curdir=PRAGMA('D')
  1770.   CALL setdir(bbspath'rexxDoors')
  1771.   bbspath'rexxDoors/'doors.temp name winnings 0 colorflag 6000
  1772.   CALL setdir(curdir)
  1773.   CALL SETCLIP('BBS_localdoor')
  1774. END
  1775. CALL SETCLIP('BBS_localdoor')
  1776. RETURN
  1777.  
  1778.  
  1779. sortlibraries:
  1780. SAY 'Sorting Libraries...'
  1781. count=0
  1782. sdirs.=''
  1783. DO i=1 TO level
  1784.   IF dirs.i='' THEN ITERATE i
  1785.   count=count+1
  1786.   sdirs.count=dirs.i i
  1787. END
  1788. sdirs.0=count
  1789. IF count>0 THEN CALL QSort(1,count,sdirs)
  1790. count=0
  1791. libs.=''
  1792. DO i=1 TO sdirs.0
  1793.   tempnum=WORD(sdirs.i,2)
  1794.   tempdir=WORD(sdirs.i,1)
  1795.   IF FIND(data.21,UPPER(tempdir))=0 THEN
  1796.     DO
  1797.       string=' '
  1798.       IF tempnum<10 THEN string=string' '
  1799.       string=string || tempnum'. 'LEFT(tempdir,14)
  1800.       count=count+1
  1801.       libs.count=string
  1802.     END
  1803. END
  1804. libs.0=count%4
  1805. IF (count//4)>0 THEN libs.0=libs.0+1
  1806. DO i=1 TO libs.0
  1807.   DO j=1 TO 3
  1808.     k=i+j*libs.0
  1809.     IF k<=count THEN libs.i=libs.i||libs.k
  1810.   END
  1811. END
  1812. DROP sdirs.
  1813. CALL sortconferences()
  1814. RETURN
  1815.  
  1816.  
  1817. sortconferences:
  1818. SAY 'Sorting Conferences...'
  1819. count=0
  1820. smsg.=''
  1821. DO i=1 TO level
  1822.   IF msg.i='' THEN ITERATE i
  1823.   count=count+1
  1824.   smsg.count=msg.i i
  1825. END
  1826. smsg.0=count
  1827. IF count>0 THEN CALL QSort(1,count,smsg)
  1828. count=0
  1829. msgs.=''
  1830. DO i=1 TO smsg.0
  1831.   tempnum=WORD(smsg.i,2)
  1832.   tempdir=WORD(smsg.i,1)
  1833.   IF FIND(data.21,tempnum)=0 THEN
  1834.     DO
  1835.       string=' '
  1836.       IF tempnum<10 THEN string=string' '
  1837.       string=string || tempnum'.'
  1838.       IF WORD(data.22,tempnum)='' | WORD(data.22,tempnum)>=0 THEN
  1839.         string=string LEFT(tempdir,20)
  1840.       ELSE string=string pen3'-OFF-'def LEFT(tempdir,14)
  1841.       count=count+1
  1842.       msgs.count=string
  1843.     END
  1844. END
  1845. msgs.0=count%3
  1846. IF (count//3)>0 THEN msgs.0=msgs.0+1
  1847. DO i=1 TO msgs.0
  1848.   DO j=1 TO 2
  1849.     k=i+j*msgs.0
  1850.     IF k<=count THEN msgs.i=msgs.i msgs.k
  1851.   END
  1852. END
  1853. DROP smsg.
  1854. RETURN
  1855.  
  1856.  
  1857. readmessages:
  1858. searcharg=''
  1859. DO FOREVER
  1860.   SAY 
  1861.   PARSE VAR arg temp' 'arg .
  1862.   IF DATATYPE(temp,'W') THEN msgdir=temp
  1863.   ELSE IF LEFT(UPPER(temp),1)='A' THEN
  1864.     DO
  1865.       CALL newmsgs()
  1866.       arg=''
  1867.       RETURN
  1868.     END
  1869.   ELSE IF LEFT(UPPER(temp),1)='M' THEN
  1870.     DO
  1871.       CALL readmarked()
  1872.       arg=''
  1873.       RETURN
  1874.     END
  1875.   ELSE
  1876.     DO
  1877.       SAY 'Select Message Conference By' pen3'Number'def', ['pen3'M'def']arked only or ['pen3'A'def']ll Active'
  1878.       IF areaselect() THEN
  1879.         DO
  1880.           IF LEFT(temp,1)='A' THEN CALL newmsgs()
  1881.           IF LEFT(temp,1)='M' THEN CALL readmarked()
  1882.           RETURN
  1883.         END
  1884.     END
  1885.   pline='['pen3'A'def']rchive ['pen3'S'def']earch ['pen3'T'def']oggle ON/OFF'
  1886.   pline=pline '['pen3'R'def']ead ['pen3'Q'def']uit (aqRst) > '
  1887.   IF arg~='' THEN junk=UPPER(LEFT(arg,1))
  1888.   ELSE junk=getinput(1 1 pline)
  1889.   IF junk='Q' THEN RETURN
  1890.   IF junk='A' THEN
  1891.     DO
  1892.       SAY
  1893.       CALL msgcount(msgdir)
  1894.       junk=getinput(1 0 pen3'RETURN'def' to archive new msgs, ['pen3'Q'def']uit, or enter starting message number > ')
  1895.       IF junk='Q' THEN RETURN
  1896.       IF DATATYPE(junk,'W') THEN
  1897.         DO
  1898.           IF junk>lastmess | junk<1 THEN junk=1
  1899.           lastread.msgdir=junk-1
  1900.           CALL savedata(1)
  1901.         END
  1902.       CALL SETCLIP('BBS_MSGS','ON')
  1903.       SAY 'Archiving messages in the'pen3 msg.msgdir def'Conference...'
  1904.       lastread.msgdir=lastmess
  1905.       ADDRESS AREXX ArcMsgs.rexx name msgdir
  1906.       IF emailonline>=0 THEN emailonline=emailonline+1
  1907.       DO WHILE GETCLIP('BBS_MSGS')~=''
  1908.         CALL DELAY(14)
  1909.       END
  1910.       SAY 'When completed, the archive will be attached to email addressed to you.'
  1911.       CALL savedata(1)
  1912.       SAY
  1913.       RETURN
  1914.     END
  1915.   IF junk='S' THEN
  1916.     DO
  1917.       searcharg=''
  1918.       searcharg=getinput(0 0 pen3'Search Phrase: 'def)
  1919.       IF LENGTH(STRIP(searcharg))=0 THEN RETURN
  1920.       searcharg=COMPRESS(searcharg,'*')
  1921.       SAY
  1922.       CALL searchmsgdir()
  1923.       SAY
  1924.       SAY 'All messages in the'pen3 msg.msgdir def'Conference have been searched.'
  1925.       SAY
  1926.       CALL waiting()
  1927.       searcharg=''
  1928.       RETURN
  1929.     END
  1930.   IF junk='T' THEN
  1931.     DO
  1932.       line='Turning the' msg.msgdir 'conference'
  1933.       IF WORD(data.22,msgdir)<0 THEN
  1934.         DO
  1935.           line=line pen3'ON'def'.'
  1936.           newdata='0'
  1937.         END
  1938.       ELSE
  1939.         DO
  1940.           line=line pen3'OFF'def'.'
  1941.           newdata='-1'
  1942.         END
  1943.       SAY line
  1944.       dataloc=WORDINDEX(data.22,msgdir)-1
  1945.       data.22=DELWORD(data.22,msgdir,1)
  1946.       IF dataloc>0 THEN data.22=INSERT(newdata' ',data.22,dataloc)
  1947.       CALL sortconferences()
  1948.     END
  1949.   CALL readmsg(0)
  1950.   CALL saveData(1)
  1951.   nonstop=0
  1952.   arg=''
  1953. END
  1954. RETURN
  1955.  
  1956.  
  1957. newmsgs:
  1958. test=UPPER(LEFT(arg,1))
  1959. IF test='' THEN
  1960.   test=getinput(1 1 '['pen3'R'def']ead new messages or ['pen3'A'def']rchive for later download. (aR) > ')
  1961. IF test='A' THEN
  1962.   DO
  1963.     CALL SETCLIP('BBS_MSGS','ON')
  1964.     SAY
  1965.     SAY 'Archiving new conference messages...'
  1966.     ADDRESS AREXX ArcMsgs.rexx name
  1967.     IF emailonline>=0 THEN emailonline=emailonline+1
  1968.     clear_marked=1
  1969.     DO i=1 TO level
  1970.       IF WORD(data.22,i)~=-1 THEN
  1971.         lastread.i=countcheck(bbspath'Numbers/LastMessage'i 0)
  1972.     END
  1973.     DO WHILE GETCLIP('BBS_MSGS')~=''
  1974.       CALL DELAY(14)
  1975.     END
  1976.     SAY 'When completed, the archive will be attached to email addressed to you.'
  1977.     CALL savedata(1)
  1978.     SAY
  1979.     RETURN
  1980.   END
  1981. curmsgdir=msgdir
  1982. SAY 'Scanning all Conferences for new messages..'
  1983. DO newi=1 TO level
  1984.   IF msg.newi='' THEN ITERATE newi
  1985.   msgdir=newi
  1986.   CALL readmsg(1)
  1987.   IF msgcom='Q' THEN LEAVE newi
  1988. END
  1989. CALL saveData(1)
  1990. msgdir=curmsgdir
  1991. nonstop=0
  1992. RETURN
  1993.  
  1994.  
  1995. readmsg:
  1996. ARG quietflag marknum .
  1997. msgcom=''
  1998. IF msg.msgdir='' | FIND(data.21,msgdir)>0 THEN RETURN; /* sysop excluded */
  1999. IF WORD(data.22,msgdir)=-1 THEN RETURN;                /*  user excluded */
  2000. entering='Entering'pen3 msg.msgdir def'Message Conference..'
  2001. IF quietflag=0 & marknum='' THEN SAY entering
  2002. IF DATATYPE(WORD(data.22,msgdir),'W') THEN
  2003.   lastread.msgdir=WORD(data.22,msgdir)
  2004. ELSE lastread.msgdir=0
  2005. lstwrt=countcheck(bbspath'Numbers/LastMessage'msgdir 0)
  2006. frstwrt=countcheck(bbspath'Numbers/FirstMessage'msgdir 0)
  2007. temp=''
  2008. IF marknum='' THEN
  2009.   DO
  2010.     IF lastread.msgdir>=lstwrt | lastread.msgdir<frstwrt THEN
  2011.       DO
  2012.         CALL msgcount(msgdir)
  2013.         IF quietflag=1 & lastread.msgdir=lstwrt THEN RETURN
  2014.         IF nonstop=1 THEN temp=lastread.msgdir
  2015.         ELSE temp=getinput(1 0 pen3'Enter starting message number > 'def)
  2016.         IF temp='' & lastread.msgdir<lstwrt THEN temp=lastread.msgdir
  2017.         IF ~DATATYPE(temp,'W') THEN RETURN
  2018.         IF temp<frstwrt THEN temp=frstwrt
  2019.         IF temp>lstwrt THEN temp=lstwrt
  2020.         IF temp<1 THEN temp=1
  2021.         lastread.msgdir=temp-1
  2022.       END
  2023.   END
  2024. ELSE lastread.msgdir=marknum-1
  2025. IF quietflag=1 THEN SAY entering
  2026. dirname=msgpath||msgdir
  2027. msglist.=0 /* set read to 0, unread to 1, and reply >=2 */
  2028. firstmess=999999
  2029. testlist=SHOWDIR(dirname)
  2030. DO i=1 TO WORDS(testlist)
  2031.   test=WORD(testlist,i)
  2032.   IF test>lastread.msgdir THEN msglist.test=1
  2033.   IF test<firstmess THEN firstmess=test
  2034. END
  2035. IF firstmess=999999 THEN firstmess=0
  2036. CALL countcheck(bbspath'Numbers/FirstMessage'msgdir firstmess)
  2037. msgstatus=1
  2038. IF temp='' & marknum='' THEN CALL msgcount(msgdir)
  2039. late.=''
  2040. late.0=0
  2041. skipsubj.=''
  2042. skipsubj.0=0
  2043. DO msgloop=1
  2044.   lastreadnum=lastread.msgdir
  2045.   DO WHILE msglist.lastreadnum=0 & lastreadnum<lstwrt
  2046.     lastreadnum=lastreadnum+1
  2047.   END
  2048.   lastread.msgdir=lastreadnum
  2049.   IF lastreadnum=lstwrt & msglist.lstwrt=0 THEN LEAVE msgloop
  2050.   DO mess=lastread.msgdir TO lstwrt+1
  2051.     IF marknum~='' THEN
  2052.       DO
  2053.         IF mess>marknum THEN LEAVE msgloop
  2054.         mess=marknum
  2055.       END
  2056.     IF msglist.mess~=msgstatus THEN ITERATE mess
  2057.     IF msgstatus>1 THEN SAY 'Following the thread, level' msgstatus-1'.'
  2058.     msglist.mess=0
  2059.     arg=dirname'/'mess
  2060.     IF ~EXISTS(arg) THEN
  2061.       DO
  2062.         SAY 'Message number' mess 'is missing.'
  2063.         ITERATE mess
  2064.       END
  2065.     IF ~readopen(arg) THEN ITERATE mess
  2066.     firstline=READLN(f)
  2067.     secondline=READLN(f)
  2068.     thirdline=READLN(f)
  2069.     forthline=READLN(f)
  2070.     CALL CLOSE(f)
  2071.     CALL killmark(msgdir mess)
  2072.     DO skp=1 TO skipsubj.0
  2073.       IF forthline=skipsubj.skp THEN ITERATE mess
  2074.     END
  2075.     IF WORDS(firstline)>2 THEN /* if replies, change their num to >1 */
  2076.       DO
  2077.         thread=SUBSTR(firstline,WORDINDEX(firstline,4))
  2078.         DO tindx=1 TO WORDS(thread)
  2079.           test=WORD(thread,tindx)
  2080.           IF msglist.test~=0 THEN msglist.test=msgstatus+1
  2081.         END
  2082.       END
  2083.     ELSE thread=''
  2084.     savearg=arg
  2085.     msgcom='A'
  2086.     DO msgloop2=1 WHILE msgcom='A' | msgcom='O'
  2087.       CALL readlines(arg 1)
  2088.       IF nonstop=1 THEN rnonstop=1
  2089.       ELSE rnonstop=0
  2090.       CALL seelines(2)
  2091.       IF name=WORD(lynes.3,2) THEN
  2092.         DO
  2093.           IF WORDS(lynes.3)//2=0 THEN
  2094.             DO
  2095.               lynes.3=lynes.3'  (Rcvd)'
  2096.               edtype=''
  2097.               CALL savelines(arg)
  2098.             END
  2099.         END
  2100.       msgcom=''
  2101.       IF rnonstop THEN
  2102.         DO
  2103.           SAY
  2104.           nonstop=1
  2105.           msgcom=''
  2106.         END
  2107.       ELSE
  2108.         DO
  2109.           pline=''
  2110.           IF level<=sysoplevel | WORDS(lynes.3)<4 THEN pline='['pen3'A'def']gain'
  2111.           IF level>sysoplevel | name=WORD(lynes.2,2) THEN
  2112.             pline=pline '['pen3'E'def']dit ['pen3'K'def']ill'
  2113.           IF level>sysoplevel THEN pline=pline '['pen3'M'def']ove'
  2114.           IF WORDS(lynes.3)>3 THEN pline=pline '['pen3'O'def']riginal'
  2115.           pline=pline '['pen3'N'def']onStop ['pen3'R'def']eply'
  2116.           IF level=99 THEN pline=pline '['pen3'!'def']'
  2117.           pline=pline '['pen3'S'def']kip ['pen3'Q'def']uit ['pen3'?'def']'
  2118.           msgcom=getinput(1 0 STRIP(pline)' > ')
  2119.           CALL cleanline(0)
  2120.         END
  2121.       IF DATATYPE(msgcom,'W') & EXISTS(dirname'/'msgcom) THEN
  2122.         DO
  2123.           arg=dirname'/'msgcom
  2124.           IF msgcom>lastread.msgdir THEN lastread.msgdir=msgcom
  2125.           msgcom='A'
  2126.           ITERATE msgloop2
  2127.         END
  2128.       ELSE msgcom=LEFT(msgcom,1)
  2129.       IF msgcom='Q' THEN LEAVE msgloop
  2130.       ELSE IF msgcom='!' & level>sysoplevel THEN
  2131.         DO
  2132.           CALL DELETE(arg)
  2133.           newchar=LEFT(lynes.1,1)
  2134.           IF newchar~='!' THEN newchar='!!'
  2135.           ELSE newchar='  '
  2136.           lynes.1=OVERLAY(newchar,lynes.1,1,2)
  2137.           CALL savelines(arg)
  2138.           ITERATE msgloop2
  2139.         END
  2140.       ELSE IF msgcom='A' THEN ITERATE msgloop2
  2141.       ELSE IF msgcom='M' & level>sysoplevel THEN
  2142.         DO
  2143.           prevmsgdir=msgdir
  2144.           If ~areaselect() THEN
  2145.             DO
  2146.               himsg=countcheck(bbspath'Numbers/LastMessage'msgdir 0)+1
  2147.               lynes.1='  Msg:' himsg
  2148.               lynes.3='   To:' WORD(lynes.3,2)
  2149.               lynes.5=STRIP(DELWORD(lynes.5,8,1)) msg.msgdir
  2150.               nlyn=lynes.0+1
  2151.               lynes.0=nlyn
  2152.               lynes.nlyn=' *** Moved from the' msg.prevmsgdir 'conference ***'
  2153.               CALL savelines(msgpath||msgdir'/'himsg)
  2154.               CALL countcheck(bbspath'Numbers/LastMessage'msgdir himsg)
  2155.               CALL msgmark(WORD(lynes.3,2) msgdir himsg)
  2156.               CALL readlines(arg 1)
  2157.               CALL DELETE(arg)
  2158.               CALL DELAY(28)
  2159.               lynes.0=7
  2160.               lynes.7='*** Moved to the' msg.msgdir 'conference, message #'himsg' ***'
  2161.               CALL savelines(arg)
  2162.             END
  2163.           msgdir=prevmsgdir
  2164.           msgcom='A'
  2165.         END
  2166.       ELSE IF msgcom='N' THEN
  2167.         DO
  2168.           nonstop=1
  2169.           msgcom=''
  2170.         END
  2171.       ELSE IF msgcom='H' | msgcom='?' THEN
  2172.         DO
  2173.           SAY pen3' - HELP with the Read Messages commands -'def
  2174.           SAY ' RETURN reads the next message in line.'
  2175.           SAY ' 34 will read message number 34, if it exists in this conference.'
  2176.           SAY ' A  reads this message Again (in case it scrolled off screen).'
  2177.           IF level>sysoplevel | name=WORD(lynes.2,2) THEN
  2178.             DO
  2179.           SAY ' E  puts this message into the online Editor.'
  2180.           SAY ' K  deletes a message you wrote. you cannot Kill others!'
  2181.             END
  2182.           IF level>sysoplevel THEN
  2183.           SAY ' M  move this message to a new conference.'
  2184.           SAY ' N  displays all new messages without pausing. CTRL-E to Exit!'
  2185.           SAY ' O  if this message is a reply, will read the Original message.'
  2186.           SAY ' R  enters the message editor to Reply to this message.'
  2187.           SAY ' S  allows you to Skip threads or conferences.'
  2188.         IF level=99 THEN
  2189.           SAY ' !  toggles the do-not-purge! flag for this message.'
  2190.           SAY ' Q  returns to the message menu. (Quit)'
  2191.           SAY
  2192.           CALL waiting()
  2193.           msgcom='A'
  2194.           IF waitchar='Q' THEN LEAVE msgloop
  2195.         END
  2196.       ELSE IF msgcom='E' THEN
  2197.         DO
  2198.           IF level>sysoplevel | name=WORD(lynes.2,2) THEN
  2199.             DO
  2200.               sline=7
  2201.               IF level>sysoplevel THEN sline=1
  2202.               CALL bbsED(sline arg)
  2203.               msgcom='A'
  2204.             END
  2205.         END
  2206.       ELSE IF msgcom='S' & mess<lstwrt THEN
  2207.         DO
  2208.           stemp=''
  2209.           req='Skip'
  2210.           IF WORDS(lynes.1)>2 THEN req=req 'this ['pen3'T'def']hread or'
  2211.           ELSE SAY 'There are no replies to this message.'
  2212.           req=req 'the entire ['pen3'C'def']onference? ('
  2213.           IF WORDS(lynes.1)>2 THEN tst='cqt'
  2214.           ELSE tst='cq'
  2215.           DO WHILE POS(stemp,UPPER(tst))=0
  2216.             stemp=getinput(1 1 req||tst') >')
  2217.           END
  2218.           IF stemp='T' THEN
  2219.             DO
  2220.               SAY
  2221.               SAY pen3 forthline||def
  2222.               SAY 'Skipping messages associated with this message...'
  2223.               SAY
  2224.               DO i=lastread.msgdir TO lstwrt
  2225.                 IF msglist.i>1 THEN msglist.i=0
  2226.               END
  2227.               skipsubj.0=skipsubj.0+1
  2228.               sksb=skipsubj.0
  2229.               skipsubj.sksb=forthline
  2230.             END
  2231.           ELSE IF stemp='C' THEN
  2232.             DO
  2233.               SAY pen3'Skipping to the last message in the'def msg.msgdir pen3'conference.'def
  2234.               lastread.msgdir=lstwrt-1
  2235.               lw=lstwrt-1
  2236.               msglist.lw=0
  2237.               msglist.lstwrt=1
  2238.               LEAVE mess
  2239.             END
  2240.         END
  2241.       ELSE IF msgcom='K' THEN
  2242.         DO
  2243.           IF level>sysoplevel | name=WORD(lynes.2,2) THEN
  2244.             DO
  2245.               IF getinput(1 1 'Really delete' arg'? (Ny) > ')='Y' THEN
  2246.                 DO
  2247.                   IF DELETE(arg)=1 THEN
  2248.                     SAY pen3||arg||def' has been deleted.'
  2249.                   grand=grand-1
  2250.                   msg.msgdir.0=msg.msgdir.0-1
  2251.                 END
  2252.             END
  2253.         END
  2254.       ELSE IF msgcom='O' THEN   /* go back and read original */
  2255.         DO
  2256.           IF WORDS(lynes.3)>3 THEN
  2257.             DO
  2258.               temp=WORD(lynes.3,4)
  2259.               arg=dirname'/'temp
  2260.             END
  2261.           ELSE SAY 'This is the original message.'
  2262.         END
  2263.       ELSE IF msgcom='R' THEN   /*  toname     msgnum  */
  2264.         DO
  2265.           IF thread~='' & marknum='' THEN
  2266.             DO
  2267.               li='Read the replies to this message before answering? (nY) > '
  2268.               IF getinput(1 1 li)~='N' THEN
  2269.                 DO
  2270.                   n=late.0+1
  2271.                   late.0=n
  2272.                   late.n=msgstatus
  2273.                   late.n.0=arg
  2274.                   ITERATE msgloop2
  2275.                 END
  2276.             END
  2277.           CALL do_reply(mess)
  2278.         END
  2279.       ELSE IF arg~=savearg THEN /* Continue */
  2280.         DO
  2281.           msgcom='A'
  2282.           arg=savearg
  2283.         END
  2284.     END
  2285.     IF thread~='' THEN
  2286.       DO
  2287.         thread=''
  2288.         msgstatus=msgstatus+1
  2289.       END
  2290.   END
  2291.   IF msgstatus>0 THEN
  2292.     DO
  2293.       IF msgstatus>1 THEN msgstatus=msgstatus-1
  2294.       CALL do_late()
  2295.     END
  2296. END
  2297. msgstatus=0
  2298. CALL do_late()
  2299. DROP msglist. skipsubj. late.
  2300. IF quietflag~=1 THEN nonstop=0
  2301. RETURN
  2302.  
  2303.  
  2304. do_late:
  2305. DO lt=1 TO late.0
  2306.   IF late.lt='' THEN ITERATE lt
  2307.   IF msgstatus<=late.lt THEN
  2308.     DO
  2309.       SAY CR
  2310.       SAY bak2' Reviewing message marked for reply...'def
  2311.       late.lt=''
  2312.       CALL readlines(late.lt.0 1)
  2313.       CALL seelines(2)
  2314.       ps='Reply to this message? (nY) > '
  2315.       IF getinput(1 1 ps)~='N' THEN CALL do_reply(0)
  2316.     END
  2317. END
  2318. RETURN
  2319.  
  2320.  
  2321. do_reply:
  2322. ARG mes
  2323. msgnum=WORD(lynes.1,2)
  2324. forthline=lynes.4
  2325. IF editor('REPLY' WORD(lynes.2,2) msgnum) THEN /* reply */
  2326.   DO
  2327.     savearg2=arg
  2328.     arg=dirname'/'WORD(lynes.3,4)
  2329.     IF EXISTS(arg) THEN
  2330.       DO
  2331.         IF readlines(arg 1) THEN BREAK
  2332.         xmsg=countcheck(bbspath'Numbers/LastMessage'msgdir mes)
  2333.         IF WORDS(lynes.1)>3 THEN lynes.1=lynes.1 xmsg
  2334.         ELSE lynes.1=lynes.1'   Reply' xmsg
  2335.         CALL DELAY(28)    /* allow 1/2 sec for read to close */
  2336.         CALL savelines(arg)
  2337.       END
  2338.     arg=savearg2
  2339.   END
  2340. RETURN
  2341.  
  2342.  
  2343. showmarked:
  2344. ARG ff .
  2345. IF WORDS(data.24)<1 THEN RETURN
  2346. fline='These unread conference messages have been ['pen3'M'pen6']arked as addressed to you:'
  2347. IF ff THEN
  2348.   DO
  2349.     SAY
  2350.     SAY pen6||fline||def
  2351.   END
  2352. tempkk=data.24
  2353. DO i=1 TO WORDS(tempkk)
  2354.   tempk=WORD(tempkk,i)
  2355.   PARSE VAR tempk kdir'/'kmsg
  2356.   line=RIGHT(kmsg,6) 'in the'pen3 msg.kdir def'conference'
  2357.   IF EXISTS(msgpath||tempk) THEN
  2358.     DO
  2359.       IF ff THEN SAY line'.'
  2360.       ELSE fline=fline'0A'x||line'.'
  2361.     END
  2362.   ELSE
  2363.     DO
  2364.       line=line 'is missing.'
  2365.       IF ff THEN SAY line
  2366.       ELSE fline=fline'0A'x||line
  2367.       data.24=DELWORD(data.24,FIND(data.24,tempk),1)
  2368.     END
  2369. END
  2370. IF ff THEN
  2371.   DO
  2372.     CALL waiting()
  2373.     SAY
  2374.   END
  2375. ELSE
  2376.   DO
  2377.     IF writeopen(bbspath'EmailFiles/'name'/Marked')=0 THEN RETURN
  2378.     CALL WRITELN(f,fline)
  2379.     CALL CLOSE(f)
  2380.   END
  2381. RETURN
  2382.  
  2383.  
  2384. killmark:
  2385. PARSE ARG kdir kmsg .
  2386. IF data.24='' THEN RETURN
  2387. markword=FIND(data.24,kdir'/'kmsg)
  2388. IF markword>0 THEN data.24=STRIP(DELWORD(data.24,markword,1))
  2389. RETURN
  2390.  
  2391.  
  2392. readmarked:
  2393. mrknum=WORDS(data.24)
  2394. IF mrknum=0 THEN RETURN
  2395. SAY 'Reading only messages addressed to you...'
  2396. mrklist=data.24
  2397. msgcom=''
  2398. DO rmki=1 TO mrknum WHILE msgcom~='Q'
  2399.   tempk=WORD(mrklist,rmki)
  2400.   PARSE VAR tempk mkdir'/'mkmsg .
  2401.   IF ~EXISTS(msgpath||tempk) THEN
  2402.     DO
  2403.       CALL killmark(mkdir mkmsg)
  2404.       SAY
  2405.       SAY 'Message number' mkmsg 'in the' msg.mkdir 'conference is missing!'
  2406.       SAY
  2407.       ITERATE rmki
  2408.     END
  2409.   msgdir=mkdir
  2410.   savelast=lastread.msgdir
  2411.   CALL readmsg(1 mkmsg)
  2412.   IF mkmsg>savelast THEN lastread.msgdir=mkmsg
  2413.   ELSE lastread.msgdir=savelast
  2414. END
  2415. CALL saveData(1)
  2416. RETURN
  2417.  
  2418.  
  2419. sortnumbers:
  2420. PARSE ARG slist
  2421. IF STRIP(slist)='' THEN RETURN ''
  2422. sorted.=''
  2423. oldest=999999
  2424. newest=0
  2425. newlist=''
  2426. DO si=1 TO WORDS(slist)
  2427.   testword=WORD(slist,si)
  2428.   IF ~DATATYPE(testword,'W') THEN
  2429.     DO
  2430.       testpos=LASTPOS('.',testword)
  2431.       IF testpos>0 THEN tempnum=SUBSTR(testword,testpos+1)
  2432.       ELSE
  2433.         DO
  2434.           newlist=testword newlist
  2435.           ITERATE si
  2436.         END
  2437.     END
  2438.   ELSE tempnum=testword/1
  2439.   IF sorted.tempnum='' THEN
  2440.     DO
  2441.       sorted.tempnum=testword
  2442.       sorted.tempnum.0=1
  2443.       IF DATATYPE(tempnum,'W') THEN
  2444.         DO
  2445.           IF tempnum>newest THEN newest=tempnum
  2446.           IF tempnum<oldest THEN oldest=tempnum
  2447.         END
  2448.     END
  2449.   ELSE newlist=newlist testword
  2450. END
  2451. IF oldest~=999999 & newest~=0 THEN
  2452.   DO si=oldest TO newest
  2453.     IF sorted.si.0=1 THEN newlist=newlist sorted.si
  2454.   END
  2455. DROP sorted. oldest newest
  2456. RETURN STRIP(newlist)
  2457.  
  2458.  
  2459. readmail:
  2460. ARG fromenu .
  2461. replysubj=''
  2462. IF fromenu THEN
  2463.   DO
  2464.     temp=UPPER(arg)
  2465.     arg=''
  2466.     IF temp~='F' & temp~='T' & temp~='W' THEN
  2467.       DO
  2468.         line='Find Email ['pen3'F'def']rom You ['pen3'T'def']o You or ['pen3'W'def']rite New Email (ftw) > 'def
  2469.         temp=getinput(1 1 line)
  2470.         CALL cleanline(0)
  2471.       END
  2472.     IF temp='W' THEN
  2473.       DO
  2474.         CALL editor('MAIL')
  2475.         RETURN
  2476.       END
  2477.     ELSE IF temp='F' THEN
  2478.       DO
  2479.         firsteditline=0
  2480.         picklist.=''
  2481.         picklist.0=0
  2482.         IF getinput(1 1 'Check ALL users? (nY) > ')='N' THEN
  2483.           DO
  2484.             picklist.1=getinput(1 0 'Check EMail From' name 'To Who? > ')
  2485.             picklist.1=SPACE(STRIP(UPPER(picklist.1)),1,'_')
  2486.             picklist.1=COMPRESS(picklist.1,'.,:/*#?^ ')
  2487.             IF picklist.1='' THEN RETURN
  2488.             IF FIND(userlist,picklist.1)=0 THEN
  2489.               DO
  2490.                 SAY '***'pen3 picklist.1 def'does not exist!'
  2491.                 picklist.0=0
  2492.                 RETURN
  2493.               END
  2494.             fmaillist=SHOWDIR(bbspath'EMail/'picklist.1)
  2495.             DO ej=1 TO WORDS(fmaillist)
  2496.               ejname=WORD(fmaillist,ej)
  2497.               uname=ejname
  2498.               caret=LASTPOS('.',uname)
  2499.               IF caret>2 THEN uname=LEFT(uname,caret-1)
  2500.               IF uname=name THEN
  2501.                 DO
  2502.                   arg=bbspath'EMail/'picklist.1'/'ejname
  2503.                   IF EXISTS(arg) THEN
  2504.                     DO
  2505.                       pklst=picklist.0+1
  2506.                       picklist.pklst=picklist.1
  2507.                       picklist.pklst.0=ejname
  2508.                       picklist.0=pklst
  2509.                     END
  2510.                 END
  2511.             END
  2512.             IF picklist.0=0 THEN SAY 'No Email FROM you was found.'
  2513.             ELSE
  2514.               DO
  2515.                 SAY pen3'You have the following Email pending:'def
  2516.                 pickcheck=1
  2517.                 DO WHILE pickcheck~=0
  2518.                   pickcheck=pickfromlist()
  2519.                   IF pickcheck~=0 THEN
  2520.                     DO
  2521.                       firsteditline=5
  2522.                       IF level>sysoplevel THEN firsteditline=1
  2523.                       CALL bbsED(firsteditline bbspath'Email/'picklist.pickcheck'/'picklist.pickcheck.0)
  2524.                       IF ~EXISTS(bbspath'Email/'picklist.pickcheck'/'picklist.pickcheck.0) THEN
  2525.                         picklist.pickcheck='- KILLED -'
  2526.                     END
  2527.                 END
  2528.               END
  2529.           END
  2530.         ELSE
  2531.           DO
  2532.             users=WORDS(userlist)
  2533.             SAY pen3'Scanning'def users pen3'email directories...'def||CR
  2534.             SAY pen3' - To ABORT, press CTRL-E -'def||CR
  2535.             DO wi=1 TO users
  2536.               CALL busywait(60 wi users)
  2537.               fmaillist=SHOWDIR(bbspath'EMail/'WORD(userlist,wi))
  2538.               DO ej=1 TO WORDS(fmaillist)
  2539.                 ejname=WORD(fmaillist,ej)
  2540.                 uname=ejname
  2541.                 caret=LASTPOS('.',uname)
  2542.                 IF caret>2 THEN uname=LEFT(uname,caret-1)
  2543.                 IF uname=name THEN
  2544.                   DO
  2545.                     arg=bbspath'EMail/'WORD(userlist,wi)'/'ejname
  2546.                     IF EXISTS(arg) THEN
  2547.                       DO
  2548.                         pklst=picklist.0+1
  2549.                         picklist.pklst=WORD(userlist,wi)
  2550.                         picklist.pklst.0=ejname
  2551.                         picklist.0=pklst
  2552.                       END
  2553.                   END
  2554.               END
  2555.               IF wi=999999 THEN RETURN
  2556.             END
  2557.             CALL busywait(4 0)
  2558.             IF picklist.0=0 THEN SAY lineup'No Email FROM you was found.                    '
  2559.             ELSE
  2560.               DO
  2561.                 SAY pen3'You have Email pending to the following users:'def
  2562.                 pickcheck=1
  2563.                 DO WHILE pickcheck~=0
  2564.                   pickcheck=pickfromlist()
  2565.                   IF pickcheck~=0 THEN
  2566.                     DO
  2567.                       firsteditline=5
  2568.                       IF level>sysoplevel THEN firsteditline=1
  2569.                       CALL bbsED(firsteditline bbspath'Email/'picklist.pickcheck'/'picklist.pickcheck.0)
  2570.                       IF ~EXISTS(bbspath'Email/'picklist.pickcheck'/'picklist.pickcheck.0) THEN
  2571.                         picklist.pickcheck='- KILLED -'
  2572.                     END
  2573.                 END
  2574.               END
  2575.           END
  2576.         DROP picklist.
  2577.         RETURN
  2578.       END
  2579.     ELSE IF temp='T' THEN BREAK
  2580.     ELSE RETURN
  2581.   END
  2582. SAY 'Checking your mailbox..'
  2583. nomail=1
  2584. CALL MAKEDIR(bbspath'EMail/'name)
  2585. mailist=sortnumbers(SHOWDIR(bbspath'Email/'name))
  2586. IF WORDS(mailist)=0 THEN
  2587.   DO
  2588.     SAY lineup'Your mailbox is empty.  '
  2589.     SAY
  2590.     RETURN
  2591.   END
  2592. line=WORDS(mailist)
  2593. IF line>1 THEN line=line 'letters'
  2594. ELSE line=line 'letter'
  2595. line=line 'waiting.'
  2596. SAY line
  2597. DO ii=1 TO WORDS(mailist)
  2598.   SAY 'Email:' pen3||WORD(mailist,ii)||def
  2599. END
  2600. IF ~fromenu THEN
  2601.   IF getinput(1 1 'Read your private mail now? (nY) > ')='N' THEN RETURN
  2602. onename=''
  2603. IF WORDS(mailist)>3 THEN
  2604.   DO
  2605.     IF getinput(1 1 'Read all private mail? (nY) > ')='N' THEN
  2606.       DO
  2607.         onename=getinput(1 0 'Read ONLY private mail from? > ')
  2608.         onename=SPACE(STRIP(UPPER(onename)),1,'_')
  2609.         onename=COMPRESS(onename,'.,:/*#?^ ')
  2610.         IF onename='' THEN RETURN
  2611.         IF FIND(userlist,onename)=0 & picklist.1~='BBBBS' THEN
  2612.           DO
  2613.             SAY '***'pen3 onename def'does not exist!'
  2614.             RETURN
  2615.           END
  2616.       END
  2617.   END
  2618. DO letter=1 TO WORDS(mailist)
  2619.   readname=WORD(mailist,letter)
  2620.   uname=readname
  2621.   caret=LASTPOS('.',uname)
  2622.   IF caret>2 THEN uname=LEFT(uname,caret-1)
  2623.   IF onename~='' & onename~=uname THEN ITERATE letter
  2624.   arg=bbspath'Email/'name'/'readname        /* user has mail! */
  2625.   CALL readlines(arg 1)
  2626.   delnum=WORD(lynes.1,2)
  2627.   CALL seelines(1)
  2628.   nomail=0
  2629.   nonstop=0
  2630.   mailfile=''
  2631.   IF UPPER(WORD(lynes.1,3))='FILE:' THEN mailfile=WORD(lynes.1,4)
  2632.   ELSE IF UPPER(WORD(lynes.2,3))='FILE:' THEN mailfile=WORD(lynes.2,4)
  2633.   IF mailfile~='' & readname~='NEW_FILES' & readname~='FILELISTS_REPORT' & readname~='INACTIVE_USERS' & LEFT(readname,3)~='MSG' THEN
  2634.     DO
  2635.       IF LEFT(RIGHT(mailfile,4),1)~='.' & LEFT(readname,6)='BBBBS.' THEN
  2636.         DO
  2637.           SAY
  2638.           SAY pen3'The attached file is unarchived and may be incomplete.'
  2639.           SAY 'If the archiver is still building this file, downloading will fail.'def
  2640.           IF getinput(1 1 'Do you want to try to download it anyway? (Ny) > ')~='Y' THEN ITERATE letter
  2641.           SAY
  2642.         END
  2643.       curdir=PRAGMA('D')
  2644.       CALL setdir(bbspath'EmailFiles/'name)
  2645.       ADDRESS COMMAND 'C:List >*' mailfile 'DATES'
  2646.       SAY ' Attached file:' pen3||mailfile||def
  2647.       junk=getinput(1 1 'Leave file in your EmailFiles? (Ny) > ')
  2648.       IF junk='Y' THEN mailfile=''
  2649.       ELSE
  2650.         DO
  2651.           junk=getinput(1 1 'Deleting Mail will also delete file. Copy somewhere now? (Ny) > ')
  2652.           IF junk='Y' THEN
  2653.             DO
  2654.               savearg=arg
  2655.               arg=mailfile
  2656.               CALL dload()
  2657.               arg=savearg
  2658.             END
  2659.             CALL setdir(curdir)
  2660.         END
  2661.     END
  2662.   IF readname~='NEW_FILES' & readname~='FILELISTS_REPORT' & readname~='INACTIVE_USERS' & LEFT(readname,3)~='MSG' & LEFT(readname,6)~='BBBBS.' THEN
  2663.     DO
  2664.       tempchar='A'
  2665.       DO WHILE tempchar='A'
  2666.         tempchar=getinput(1 1 '['pen3'A'def']gain  ['pen3'C'def']ontinue  ['pen3'R'def']eply? (acR) > ')
  2667.         IF tempchar='' THEN tempchar='R'
  2668.         IF tempchar='A' THEN CALL seelines(1)
  2669.       END
  2670.       IF tempchar='R' THEN
  2671.         DO
  2672.           IF WORDS(lynes.4)<2 THEN replysubj='NONE'
  2673.           ELSE replysubj=SUBSTR(lynes.4,WORDINDEX(lynes.4,2))
  2674.           CALL editor('MAIL' uname)
  2675.           replysubj=''
  2676.         END
  2677.     END
  2678.   IF LEFT(readname,6)~='BBBBS.' THEN
  2679.     DO
  2680.       tempchar='A'
  2681.       DO WHILE tempchar='A'
  2682.         tempchar=getinput(1 1 'Forward mail from'pen3 uname def'to other users? (aNy) > ')
  2683.         IF tempchar='A' THEN CALL seelines(1)
  2684.       END
  2685.       IF tempchar='Y' THEN
  2686.         DO
  2687.           IF selectchosen(1 pen3'Forward Email To: 'def)=0 THEN
  2688.             DO ei=1 TO thechosen.0 WHILE thechosen.ei~=''
  2689.               CALL MAKEDIR(bbspath'EMail/'thechosen.ei)
  2690.               forwardarg=bbspath'Email/'thechosen.ei'/'readname
  2691.               ADDRESS COMMAND 'C:COPY' bbspath'Email/'name'/'readname forwardarg
  2692.               CALL readlines(forwardarg 1)
  2693.               lynes.1=lynes.1'  Forwarded to you by' name TIME('C') DATE()
  2694.               CALL DELETE(forwardarg)
  2695.               CALL savelines(forwardarg)
  2696.               IF WORDS(lynes.2)>3 THEN
  2697.                 DO
  2698.                   forname=bbspath'EmailFiles/'name'/'WORD(lynes.2,4)
  2699.                   IF EXISTS(forname) THEN
  2700.                     DO
  2701.                       CALL MAKEDIR(bbspath'EmailFiles/'thechosen.ei)
  2702.                       ADDRESS COMMAND 'C:COPY' forname bbspath'EmailFiles/'thechosen.ei
  2703.                     END
  2704.                 END
  2705.               line='Mail' pen3||readname||def 'forwarded to' pen3||thechosen.ei||def
  2706.               IF emailonline>=0 THEN emailonline=emailonline+1
  2707.               SAY line
  2708.             END
  2709.         END
  2710.     END
  2711.   tempchar=''
  2712.   tempstr='Delete the mail ('pen3||delnum||def') from'pen3 uname def'that you just read?'
  2713.   IF mailfile='' THEN tempchar=getinput(1 1 tempstr '(nqY) > ')
  2714.   ELSE
  2715.     DO WHILE tempchar~='N' & tempchar~='Q' & tempchar~='Y'
  2716.       tempchar=getinput(1 1 tempstr '(nqy) > ')
  2717.     END
  2718.   IF tempchar='Q' THEN
  2719.     DO
  2720.       IF getinput(1 1 'Quit reading your Email? (Ny) > ')='Y' THEN
  2721.         DO
  2722.           readname=''
  2723.           uname=''
  2724.           RETURN
  2725.         END
  2726.     END
  2727.   ELSE IF tempchar~='N' THEN
  2728.     DO
  2729.       dirname=bbspath'Email/'name'/'
  2730.       nodelete=0
  2731.       IF bbsprefs.14=1 & name~=sysop & uname~=sysop & WORD(lynes.2,2)~='BBBBS' & WORD(lynes.2,2)~=sysop & WORD(lynes.3,2)~=sysop THEN
  2732.         nodelete=1
  2733.       IF nodelete THEN
  2734.         ADDRESS COMMAND 'C:Copy' dirname||readname bbspath'Email/'sysop
  2735.       ELSE emailonline=emailonline-1
  2736.       CALL DELETE(dirname||readname)
  2737.       tempstr='Old email'
  2738.       IF mailfile~='' & readname~='NEW_FILES' & readname~='FILELISTS_REPORT' & readname~='INACTIVE_USERS' & EXISTS(bbspath'EmailFiles/'name'/'mailfile) THEN
  2739.         DO
  2740.           IF nodelete THEN
  2741.             ADDRESS COMMAND 'C:Copy' bbspath'EmailFiles/'name'/'mailfile bbspath'EmailFiles/'sysop
  2742.           CALL DELETE(bbspath'EmailFiles/'name'/'mailfile)
  2743.           CALL DELETE(bbspath'EmailFiles/'name'/'mailfile'.xdl')
  2744.           tempstr=tempstr 'and attached file'
  2745.         END
  2746.       tempstr=tempstr 'deleted. Thank you for keeping a clean BBS!'
  2747.       SAY tempstr
  2748.       IF tempchar='Q' THEN
  2749.         IF getinput(1 1 'Quit reading your Email? (Ny) > ')='Y' THEN
  2750.           DO
  2751.             readname=''
  2752.             uname=''
  2753.             RETURN
  2754.           END
  2755.     END
  2756.   ELSE IF LEFT(readname,3)='MSG' & level>sysoplevel THEN
  2757.     DO
  2758.       ii=LEFT(readname,POS('.',readname)-1)
  2759.       ii=SUBSTR(ii,4)%1
  2760.       IF getinput(1 1 'Move this message back to the' msg.ii 'conference? (nY) > 'def)~='N' THEN
  2761.         DO
  2762.           temp=TRANSLATE(readname,'/','.')
  2763.           temp=SUBSTR(temp,4)
  2764.           lynes.1='!!'STRIP(lynes.1)
  2765.           edtype=''
  2766.           CALL savelines(msgpath||temp)
  2767.           CALL DELETE(bbspath'Email/'name'/'readname)
  2768.         END
  2769.     END
  2770.   ELSE IF LEFT(readname,3)~='MSG' & readname~='NEW_FILES' & readname~='FILELISTS_REPORT' & readname~='INACTIVE_USERS' THEN
  2771.     DO
  2772.       arg=bbspath'Email/'name'/'readname
  2773.       CALL readlines(arg 1)
  2774.       IF WORDS(lynes.5)<7 THEN
  2775.         DO
  2776.           lynes.5=lynes.5'  (Rcvd)' DATE('W') DATE() TIME('C')
  2777.           CALL DELETE(arg)
  2778.           CALL savelines(arg)
  2779.           SAY 'Email has been marked as received.'
  2780.         END
  2781.     END
  2782.   readname=''
  2783.   uname=''
  2784.   arg=''
  2785. END
  2786. IF nomail THEN
  2787.   DO
  2788.     SAY 'No mail was found.'
  2789.     CALL waiting()
  2790.   END
  2791. CALL setdir(libpath||dirs.1)
  2792. thechosen.=''
  2793. RETURN
  2794.  
  2795.  
  2796. selectchosen:
  2797. PARSE ARG startat selectline
  2798. IF startat<2 THEN thechosen.=''
  2799. line='Enter list of comma separated user names'
  2800. IF level>sysoplevel THEN line=line 'or ALL'
  2801. SAY line
  2802. thechosen.startat=getinput(1 0 selectline' ')
  2803. IF STRIP(thechosen.startat)='' THEN RETURN 1
  2804. thechosen.startat=SPACE(thechosen.startat,1,'_')
  2805. thechosen.0=startat
  2806. IF level>sysoplevel & thechosen.startat='ALL' THEN
  2807.   thechosen.startat=SHOWDIR(bbspath'Users','F',',')
  2808. IF POS(',',thechosen.startat)>0 THEN
  2809.   DO
  2810.     temp=TRANSLATE(thechosen.startat,' ',',')
  2811.     thechosen.0=thechosen.0+WORDS(temp)-1
  2812.     DO ei=1 TO WORDS(temp)
  2813.       eii=startat+ei-1
  2814.       thechosen.eii=STRIP(WORD(temp,ei))
  2815.     END
  2816.   END
  2817. DO ei=startat TO thechosen.0
  2818.   DO WHILE FIND(userlist,thechosen.ei)=0
  2819.     IF thechosen.ei~='' THEN
  2820.       DO
  2821.         IF FIND(exclusion,thechosen.ei)>0 | thechosen.ei='BBBBS' THEN
  2822.           DO
  2823.             thechosen.ei=sysop
  2824.             ITERATE ei
  2825.           END
  2826.         CALL loadcourtesy()
  2827.         IF FIND(courtesy,thechosen.ei)>0 THEN ITERATE ei
  2828.       END
  2829.     SAY thechosen.ei 'not found! Enter that name again or press RETURN.'
  2830.     thechosen.ei=getinput(1 0 pen3||selectline' 'def)
  2831.     IF thechosen.ei='' THEN
  2832.       DO
  2833.         IF getinput(1 1 'Do you want to see the list of current users? (Ny) > ')='Y' THEN
  2834.           CALL showuserlist()
  2835.         ITERATE ei
  2836.       END
  2837.     thechosen.ei=SPACE(thechosen.ei,1,'_')
  2838.   END
  2839. END
  2840. RETURN 0
  2841.  
  2842.  
  2843. countcheck:
  2844. PARSE ARG fname' 'cknum' '.
  2845. IF ~EXISTS(fname) THEN
  2846.   DO
  2847.     IF cknum=0 THEN RETURN 0
  2848.     IF ~writeopen(fname) THEN RETURN 0
  2849.     CALL WRITELN(f,cknum)
  2850.     CALL CLOSE(f)
  2851.     RETURN cknum
  2852.   END
  2853. IF ~readopen(fname) THEN RETURN cknum
  2854. retval=STRIP(READLN(f))
  2855. CALL CLOSE(f)
  2856. IF ~DATATYPE(retval,'W') THEN retval=0
  2857. IF ~DATATYPE(cknum,'W') THEN cknum=0
  2858. IF retval<cknum THEN
  2859.   DO
  2860.     IF writeopen(fname) THEN
  2861.       DO
  2862.         CALL WRITELN(f,cknum)
  2863.         CALL CLOSE(f)
  2864.         RETURN cknum
  2865.       END
  2866.   END
  2867. RETURN retval
  2868.  
  2869.  
  2870. pickfromlist:
  2871. DO pfl=1 TO picklist.0 BY 3
  2872.   pfl2=pfl+1
  2873.   pfl3=pfl+2
  2874.   pfline=pen3||RIGHT(pfl,3)||def LEFT(picklist.pfl,21)
  2875.   IF picklist.pfl2~='' THEN
  2876.     pfline=pfline pen3||RIGHT(pfl2,3)||def LEFT(picklist.pfl2,21)
  2877.   IF picklist.pfl3~='' THEN
  2878.     pfline=pfline pen3||RIGHT(pfl3,3)||def LEFT(picklist.pfl3,21)
  2879.   SAY pfline
  2880. END
  2881. emnum=getinput(1 0 pen3'Select Email Number > 'def)
  2882. IF ~DATATYPE(emnum,'W') | emnum<1 | emnum>picklist.0 THEN RETURN 0
  2883. RETURN emnum
  2884.  
  2885.  
  2886. sysED:
  2887. IF level<99 THEN RETURN
  2888. arg=getinput(0 0 'Textfile To Edit: ')
  2889. IF arg='' THEN RETURN
  2890. CALL bbsED(1 arg)
  2891. RETURN
  2892.  
  2893.  
  2894. bbsED:
  2895. PARSE ARG firstedit editarg .
  2896. notchanged=1
  2897. IF readlines(editarg 1) THEN RETURN 1
  2898. finfo=STATEF(editarg)
  2899. IF WORDS(finfo)>7 THEN finfo=SUBSTR(finfo,WORDINDEX(finfo,8))
  2900. ELSE finfo=''
  2901. SAY 
  2902. SAY '                   'pen3'Entering the EDITOR module..'def
  2903. SAY 
  2904. count=1
  2905. DO edloop=1
  2906.   IF edcom='S' & bbsprefs.5 THEN  /* spell check */
  2907.     DO
  2908.       SAY pen3'You must use ['def'R'pen3']eplace to make corrections.  'pen2'Spellchecking...'def
  2909.       CALL DELETE(scratch'/SpellLOCAL')
  2910.       CALL savelines(scratch'/SpellLOCAL')
  2911.       curdir=PRAGMA('D')
  2912.       CALL setdir(spellpath)
  2913.       CALL SpellChk.rexx(scratch'/SpellLOCAL')
  2914.       CALL setdir(curdir)
  2915.     END
  2916.   ELSE
  2917.     DO
  2918.       IF edcom='R' | edcom='I' | edcom='L' THEN CALL wrapbuf(7)
  2919.       IF edcom~='L' THEN count=count-linesperpage
  2920.       IF count>=lynes.0 | count<1 THEN count=1
  2921.       startcount=count
  2922.       DO i=startcount TO lynes.0+1
  2923.         IF ((i+1-startcount)//linesperpage)=0 THEN
  2924.           DO
  2925.             pline='                 ['pen3'E'def']dit'
  2926.             pline=pline '  ['pen3'RETURN'def']=Continue '
  2927.             edcom=getinput(1 1 pline)
  2928.             IF edcom~='' THEN LEAVE i
  2929.             CALL cleanline(1)
  2930.           END
  2931.         SAY pen3||RIGHT(i,2)||def lynes.i
  2932.         count=count+1
  2933.       END
  2934.     END
  2935.   SAY lineup'     ['pen3'A'def']ppend ['pen3'C'def']ut     ['pen3'I'def']nsert  ['pen3'K'def']ill       ['pen3'?'def'] Help'
  2936.   pline='     ['pen3'L'def']ist   ['pen3'P'def']aste   ['pen3'R'def']eplace'
  2937.   IF bbsprefs.5 THEN pline=pline '['pen3'S'def']pellcheck'
  2938.   pline=pline '['pen3'U'def']pload-Text > '
  2939.   edcom=getinput(1 0 pline)
  2940.   IF edcom='Q' | edcom='X' THEN edcom=''
  2941.   IF edcom='?' THEN
  2942.     DO
  2943.       SAY
  2944.       SAY '                   Editor Help'
  2945.       SAY '----------------------------------------------------------'
  2946.       SAY '    an empty RETURN tells the editor you are done editing.'
  2947.       SAY ' 7  edits line number 7, if it exists.'
  2948.       SAY ' a  Append text to this file.'
  2949.       SAY ' c  Cut selected line(s) of text to buffer.'
  2950.       SAY ' i  Insert blank line.'
  2951.       SAY ' k  Kill (delete) this file.'
  2952.       SAY ' l  List this file from selected line.'
  2953.       SAY ' p  Paste buffer contents to selected line number.'
  2954.       SAY ' r  Replace a phrase or line of text.'
  2955.       SAY ' s  Spellcheck this file.'
  2956.       SAY ' u  Upload a textfile to append to this file.'
  2957.       SAY '----------------------------------------------------------'
  2958.       SAY
  2959.       OPTIONS PROMPT ''
  2960.       PULL
  2961.     END
  2962.   IF edcom='K' THEN
  2963.     DO
  2964.       junk=getinput(1 1 'Are you' pen3'sure'def 'you want to delete' editarg'? (Ny) > ')
  2965.       IF junk='Y' THEN
  2966.         DO
  2967.           IF DELETE(editarg)=1 THEN SAY editarg 'DELETED.'
  2968.           IF WORD(lynes.1,1)='Mail:' & WORDS(lynes.2)>3 THEN
  2969.             DO
  2970.               IF DELETE(bbspath'EmailFiles/'WORD(lynes.3,2)'/'WORD(lynes.2,4))=1 THEN
  2971.                 SAY WORD(lynes.2,4) 'DELETED.'
  2972.             END
  2973.           RETURN 2
  2974.         END
  2975.     END
  2976.   IF edcom='' THEN
  2977.     DO
  2978.       SAY '                   'pen3'Leaving the EDITOR module.'def
  2979.       IF notchanged THEN RETURN 0
  2980.       IF getinput(1 1 '                     Save changes? (nY)'pen3' > 'def)='N' THEN
  2981.         RETURN 1
  2982.       CALL DELETE(editarg)
  2983.       IF savelines(editarg) THEN RETURN 1
  2984.       CALL DELAY(28)
  2985.       IF finfo~='' THEN ADDRESS COMMAND 'C:filenote' editarg finfo
  2986.       SAY pen3'                        Changes saved.'def
  2987.       RETURN 0
  2988.     END
  2989.   ELSE IF edcom='C' THEN  /* Cut */
  2990.     DO
  2991.       firstnum=getinput(1 0 '   Enter line number or range 'pen3'(5-7)'def' to cut' pen3'>'def)
  2992.       IF firstnum='' THEN ITERATE edloop
  2993.       dash=POS('-',firstnum)
  2994.       IF dash>0 THEN
  2995.         DO
  2996.           lastnum=STRIP(SUBSTR(firstnum,dash+1))
  2997.           firstnum=STRIP(LEFT(firstnum,dash-1))
  2998.         END
  2999.       ELSE lastnum=firstnum
  3000.       IF ~DATATYPE(firstnum,'W') | ~DATATYPE(lastnum,'W') THEN
  3001.         DO
  3002.           junk=getinput(1 1 pen3'*** You must enter numbers here! 'def)
  3003.           ITERATE edloop
  3004.         END
  3005.       IF lastnum>lynes.0 THEN lastnum=lynes.0
  3006.       IF firstnum<firstedit THEN
  3007.         DO
  3008.           SAY '*** You are not authorized to delete that line!'
  3009.           SAY
  3010.           ITERATE edloop
  3011.         END
  3012.       IF firstnum>lastnum THEN
  3013.         DO
  3014.           SAY '*** Input error!  First number larger than last number'
  3015.           ITERATE edloop
  3016.         END
  3017.       notchanged=0
  3018.       numdiff=lastnum+1-firstnum
  3019.       pasted.=''
  3020.       pasted.0=numdiff
  3021.       k=0
  3022.       DO i=firstnum TO lynes.0
  3023.         j=i+numdiff
  3024.         k=k+1
  3025.         IF k<=numdiff THEN pasted.k=lynes.i
  3026.         lynes.i=lynes.j
  3027.         lynes.j=''
  3028.       END
  3029.       lynes.0=lynes.0-numdiff
  3030.       count=1
  3031.     END
  3032.   ELSE IF edcom='A' THEN  /* append */
  3033.     DO
  3034.       CALL writebuffer(scratch'/EditorLOCAL')
  3035.       notchanged=0
  3036.     END
  3037.   ELSE IF edcom='U' THEN  /* fileappend (upload) */
  3038.     DO
  3039.       frompath=GETCLIP('BBS_frompath')
  3040.       IF frompath='' THEN frompath='RAM:'
  3041.       farg=GetFile(150,36,frompath,'',' Select TextFile to Append ')
  3042.       IF farg~='' & EXISTS(farg) THEN
  3043.         DO
  3044.           CALL readlines(farg lynes.0+1)
  3045.           notchanged=0
  3046.           CALL SETCLIP('BBS_frompath',WORD(lastslash(farg),2))
  3047.         END
  3048.     END
  3049.   ELSE IF edcom='I' | edcom='R' | edcom='L' | edcom='P' | DATATYPE(edcom,'W') THEN
  3050.     DO
  3051.       IF DATATYPE(edcom,'W') THEN
  3052.         DO
  3053.           ednum=edcom
  3054.           edcom='R'
  3055.         END
  3056.       ELSE
  3057.         DO
  3058.           line=pen3'   '
  3059.           IF edcom='L' | edcom='P' THEN line=line'Starting '
  3060.           line=line'Line Number? > 'def
  3061.           ednum=getinput(1 0 line)
  3062.         END
  3063.       IF ~DATATYPE(ednum,'W') THEN ITERATE edloop
  3064.       IF ednum>(lynes.0+1) THEN ITERATE edloop
  3065.       IF edcom='L' THEN
  3066.         DO
  3067.           count=ednum
  3068.           ITERATE edloop
  3069.         END
  3070.       IF ednum=1 & UPPER(WORD(lynes.1,1))='FILE:' THEN
  3071.         DO
  3072.           IF getinput(1 1 pen3'Edit KeyWords:? (Ny) > 'def)='Y' THEN
  3073.             DO
  3074.               filenum=STRIP(WORD(lynes.1,2))
  3075.               num=files.filenum.0
  3076.               keywords=edkeywords(editarg)
  3077.               lynes.1=LEFT(lynes.1,21) keywords
  3078.               alpha.num=TRIM(OVERLAY(keywords,alpha.num,47,32))
  3079.               savefileflag=1
  3080.               notchanged=0
  3081.               ITERATE edloop
  3082.             END
  3083.         END
  3084.       IF ednum<firstedit THEN
  3085.         DO
  3086.           SAY '*** You are not authorized to alter that line!'
  3087.           SAY
  3088.           ITERATE edloop
  3089.         END
  3090.       IF edcom='R' THEN   /* replace */
  3091.         DO
  3092.           SAY '   Now reads:'
  3093.           SAY pen3||RIGHT(ednum,2)||def lynes.ednum
  3094.           OPTIONS PROMPT pen3'........Search text? >'def
  3095.           PARSE PULL stext
  3096.           IF LENGTH(stext)=0 THEN
  3097.             DO
  3098.               IF getinput(1 1 lineup||pen3'Replace entire line? (nY) >'def)='N' THEN
  3099.                 ITERATE edloop
  3100.               lynes.ednum=getinput(0 0 pen3||RIGHT(ednum,2)' 'def)
  3101.               notchanged=0
  3102.               ITERATE edloop
  3103.             END
  3104.           found=POS(UPPER(stext),UPPER(lynes.ednum))
  3105.           IF found=0 THEN
  3106.             DO
  3107.               SAY
  3108.               SAY stext' was not found!'
  3109.               SAY
  3110.               ITERATE edloop
  3111.             END
  3112.           OPTIONS PROMPT pen3'...Replacement text? >'def
  3113.           PARSE PULL rtext
  3114.           lynes.ednum=DELSTR(lynes.ednum,found,LENGTH(stext))
  3115.           lynes.ednum=INSERT(rtext,lynes.ednum,found-1)
  3116.           IF ednum<4 & LEFT(lynes.1,6)='File: ' THEN
  3117.             DO
  3118.               PARSE VAR lynes.1 'File: 'filenum . 'KeyWords: 'keywords
  3119.               PARSE VAR lynes.3 . 'Lib:' libnam
  3120.               filenum=STRIP(filenum)
  3121.               newc=files.filenum.0
  3122.               libnum=finddirnum(libnam)
  3123.               alpha.newc=LEFT(WORD(lynes.2,2),22-LENGTH(WORD(lynes.2,4)))
  3124.               alpha.newc=alpha.newc WORD(lynes.2,4) RIGHT(filenum,5)
  3125.               alpha.newc=alpha.newc RIGHT(libnum,2) LEFT(STRIP(libnam),12)
  3126.               alpha.newc=alpha.newc STRIP(LEFT(STRIP(keywords),32))
  3127.               savefileflag=1
  3128.             END
  3129.           SAY 'Done.'
  3130.           SAY 
  3131.           notchanged=0
  3132.         END
  3133.       ELSE IF edcom='I' THEN  /* insert */
  3134.         DO
  3135.           DO i=lynes.0 TO ednum BY -1
  3136.             j=i+1
  3137.             lynes.j=lynes.i
  3138.           END
  3139.           lynes.ednum=''
  3140.           notchanged=0
  3141.           lynes.0=lynes.0+1
  3142.           OPTIONS PROMPT pen3||RIGHT(ednum,2)'>'def
  3143.           PARSE PULL lynes.ednum
  3144.         END
  3145.       ELSE IF edcom='P' THEN   /* paste */
  3146.         DO
  3147.           DO i=lynes.0 TO ednum BY -1
  3148.             j=i+pasted.0
  3149.             lynes.j=lynes.i
  3150.           END
  3151.           DO k=1 TO pasted.0
  3152.             kk=ednum+k-1
  3153.             lynes.kk=pasted.k
  3154.           END
  3155.           notchanged=0
  3156.           lynes.0=lynes.0+pasted.0
  3157.         END
  3158.     END
  3159. END
  3160. RETURN 0
  3161.  
  3162.  
  3163. editor:
  3164. toname=''
  3165. msgnum=0
  3166. thechosen.=''
  3167. PARSE ARG edtype toname msgnum .
  3168. IF edtype='MAIL' THEN lastwrit=countcheck(bbspath'Numbers/LastMail 0')
  3169. ELSE 
  3170.   DO
  3171.     IF edtype='MSG' THEN
  3172.       DO
  3173.         tempmsgdir=0
  3174.         IF DATATYPE(arg,'W') THEN tempmsgdir=arg
  3175.         IF tempmsgdir>0 & tempmsgdir<=level & msg.tempmsgdir~='' THEN
  3176.           msgdir=tempmsgdir
  3177.         ELSE IF areaselect() THEN RETURN
  3178.       END
  3179.     lastwrit=countcheck(bbspath'Numbers/LastMessage'msgdir 0)
  3180.   END
  3181. IF toname='' THEN
  3182.   DO
  3183.     IF edtype='MAIL' THEN
  3184.       DO
  3185.         CALL selectchosen(1 pen3'Send PRIVATE' edtype lastwrit+1 'To: 'def)
  3186.         toname=thechosen.1
  3187.       END
  3188.     ELSE toname=getinput(1 0 pen3'Post A PUBLIC Message To: 'def)
  3189.   END
  3190. toname=SPACE(STRIP(UPPER(toname)),1,'_')
  3191. toname=COMPRESS(toname,'.,:/*#?^ ')
  3192. IF toname='' | FIND(exclusion,toname)>0 THEN
  3193.   DO
  3194.     IF toname='' & edtype='MSG' THEN toname='ALL'
  3195.     ELSE toname=sysop
  3196.     SAY pen3'*** Re-Addressed to'def toname
  3197.   END
  3198. IF toname~='ALL' THEN
  3199.   DO
  3200.     IF toname='BBBBS' THEN toname=sysop
  3201.     IF FIND(userlist,toname)=0 THEN
  3202.       DO
  3203.         IF courtesy='' THEN CALL loadcourtesy()
  3204.         IF FIND(courtesy,toname)=0 THEN
  3205.           DO
  3206.             SAY
  3207.             SAY bak2' 'toname' is not on the user list! 'def
  3208.             IF edtype='MAIL' THEN
  3209.               DO
  3210.                 CALL showuserlist()
  3211.                 RETURN 0
  3212.               END
  3213.             ELSE
  3214.               DO
  3215.                 IF getinput(1 1 'Do you want to use it anyway? (nY) > ')='N' THEN
  3216.                   DO
  3217.                     IF getinput(1 1 'Do you want to see the list of current users? (Ny) > ')='Y' THEN
  3218.                       CALL showuserlist()
  3219.                     RETURN 0
  3220.                   END
  3221.               END
  3222.           END
  3223.       END
  3224.   END
  3225. IF edtype='MAIL' THEN
  3226.   DO
  3227.     CALL MAKEDIR(bbspath'EMail/'toname)
  3228.     mailname=bbspath'EMail/'toname'/'name'.'lastwrit+1
  3229.   END
  3230. ELSE
  3231.   DO
  3232.     CALL MAKEDIR(msgpath||msgdir)
  3233.     mailname=msgpath||msgdir'/'lastwrit+1
  3234.   END
  3235. lynes.=''
  3236. lynes.0=6
  3237. IF edtype='MAIL' THEN lynes.1=' Mail:' lastwrit+1  /* FILE: filename */
  3238. ELSE lynes.1='  Msg:' lastwrit+1          /* Msg: MSG# REPLY # # ... */
  3239. lynes.2=' From:' name
  3240. IF city~='' THEN lynes.2=lynes.2' - 'city
  3241. lynes.3='   To:' toname                       /*  To: toname   MSG # */
  3242. IF edtype='MAIL' THEN
  3243.   DO
  3244.     IF readopen(bbspath||'Users/'toname) THEN
  3245.       DO
  3246.         CALL READLN(f)
  3247.         CALL READLN(f)
  3248.         temp=READLN(f)
  3249.         CALL CLOSE(f)
  3250.         temp=docity(temp)
  3251.         IF temp~='' THEN lynes.3=lynes.3' - 'temp
  3252.       END
  3253.     IF replysubj='|@NEW@|' THEN
  3254.       DO
  3255.         CALL readlines(bbspath'BBS_TEXT/EMAIL_WELCOME' 7)
  3256.         replysubj='Welcome to' bbsname
  3257.       END
  3258.   END
  3259. subj=''
  3260. IF edtype='REPLY' THEN
  3261.   DO
  3262.     subj=SUBSTR(forthline,WORDINDEX(forthline,2))
  3263.     SAY pen3'Subj:'def subj
  3264.     temp=getinput(0 0 'Change the current subject? (Ny) > ')
  3265.     IF LENGTH(temp)>3 THEN subj=temp
  3266.     ELSE IF LEFT(UPPER(temp),1)='Y' THEN subj=''
  3267.   END
  3268. ELSE IF edtype='MAIL' & replysubj~='' THEN subj=replysubj
  3269. IF subj='' THEN
  3270.   DO
  3271.     IF opt='C' THEN subj='FEEDBACK'
  3272.     ELSE
  3273.       DO
  3274.         SAY pen3'Enter the'def 'Subject' pen3'of this message (1 line).'def
  3275.         subj=getinput(0 0 pen3': 'def)
  3276.       END
  3277.   END
  3278. IF LENGTH(subj)>66 THEN subj=LEFT(subj,66)
  3279. IF subj='' THEN subj='?'
  3280. lynes.4=' Subj:' subj
  3281. lynes.5=' Date:' DATE('W') DATE()'  'TIME('C')
  3282. IF edtype~='MAIL' THEN lynes.5=LEFT(lynes.5,39) 'Conference:' msg.msgdir
  3283. lynes.6=LEFT('',74,'=')
  3284. IF edtype='REPLY' THEN lynes.3=lynes.3'  MSG 'msgnum
  3285. DO i=1 TO lynes.0
  3286.   SAY lynes.i
  3287. END
  3288. CALL writebuffer(scratch'/MessageLOCAL')
  3289. IF savelines(mailname) THEN RETURN 0
  3290. CALL seelines(1)
  3291. IF thechosen.0='' THEN
  3292.   DO
  3293.     thechosen.0=1
  3294.     thechosen.1=toname
  3295.   END
  3296. carbons=thechosen.0+1
  3297. DO FOREVER
  3298.   IF thechosen.0>=carbons THEN
  3299.     DO
  3300.       junk='Copies To:'
  3301.       DO cci=carbons TO thechosen.0
  3302.         junk=junk thechosen.cci
  3303.       END
  3304.       SAY junk
  3305.     END
  3306.   pline=''
  3307.   IF edtype='MAIL' THEN pline='['pen3'C'def']opies'
  3308.   pline=STRIP(pline '['pen3'E'def']dit ['pen3'K'def']ill ['pen3'R'def']ead')
  3309.   pline=pline '['pen3'U'def']pload-Text ['pen3'S'def']end' edtype'? (ekrSu) 'def
  3310.   junk=getinput(1 1 pline)
  3311.   IF junk='E' THEN
  3312.     DO
  3313.       IF level>sysoplevel THEN firstedit=1
  3314.       ELSE firstedit=7
  3315.       IF bbsED(firstedit mailname)=2 THEN RETURN 0
  3316.       junk='R'
  3317.     END
  3318.   ELSE IF edtype='MAIL' & junk='C' THEN
  3319.     DO
  3320.       CALL selectchosen(carbons pen3'Carbon Copies To: 'def)
  3321.       junk='R'
  3322.     END
  3323.   ELSE IF junk='K' THEN
  3324.     DO
  3325.       IF DELETE(mailname)=1 THEN SAY edtype 'DELETED.'
  3326.       RETURN 0
  3327.     END
  3328.   ELSE IF junk='U' THEN
  3329.     DO
  3330.       SAY 'Ready to append' pen3'TEXT ONLY'def
  3331.       pline='Are you SURE your file is un-compressed text? (Ny) > '
  3332.       IF getinput(1 1 pline)='Y' THEN
  3333.         DO
  3334.           frompath=GETCLIP('BBS_frompath')
  3335.           IF frompath='' THEN frompath='RAM:'
  3336.           farg=GetFile(150,36,frompath,'',' Select TextFile to Append ')
  3337.           IF farg~='' & EXISTS(farg) THEN
  3338.             DO
  3339.               CALL readlines(farg lynes.0+1)
  3340.               notchanged=0
  3341.               CALL SETCLIP('BBS_frompath',WORD(lastslash(farg),2))
  3342.               IF savelines(mailname) THEN RETURN 0
  3343.               CALL DELAY(28)
  3344.             END
  3345.         END
  3346.       junk='R'
  3347.     END
  3348.   IF junk='R' THEN
  3349.     DO
  3350.       CALL readlines(mailname 1)
  3351.       CALL seelines(1)
  3352.       nonstop=0
  3353.     END
  3354.   ELSE BREAK
  3355. END
  3356. IF edtype='MAIL' THEN
  3357.   DO
  3358.     IF replysubj~='' & readname~='' & LEFT(readname,5)~='BBBBS' & uname~='' & uname~='UNAME' THEN
  3359.       DO
  3360.         junk=getinput(1 1 'Attach original mail from' uname'? (nY) > ')
  3361.         IF junk~='N' THEN
  3362.           DO
  3363.             arg=bbspath'Email/'name'/'readname
  3364.             IF ~readlines(arg 1) THEN CALL savelines(mailname)
  3365.           END
  3366.       END
  3367.     junk=getinput(1 1 pen3'Attach a file to this message? (Ny) > 'def)
  3368.     IF junk='Y' THEN
  3369.       DO
  3370.         savearg=arg
  3371.         arg=''
  3372.         curdir=PRAGMA('D')
  3373.         CALL MAKEDIR(bbspath'EmailFiles/'toname)
  3374.         CALL setdir(bbspath'EmailFiles/'toname)
  3375.         IF uload(0)=0 THEN
  3376.           DO
  3377.             IF WORD(STATEF(bbspath'EmailFiles/'toname'/'arg),2)>1 THEN
  3378.               DO
  3379.                 CALL readlines(mailname 1)
  3380.                 IF arg~='' THEN lynes.1=lynes.1'  FILE: 'arg
  3381.                 CALL setdir(curdir)
  3382.                 CALL DELETE(mailname)
  3383.                 CALL savelines(mailname)
  3384.               END
  3385.           END
  3386.         ELSE
  3387.           DO
  3388.             CALL DELETE(bbspath'EmailFiles/'toname'/'arg)
  3389.             SAY pen3'*** Upload failed! ***'def
  3390.           END
  3391.         arg=savearg
  3392.       END
  3393.     totmail=WORD(data.17,2)
  3394.     IF ~DATATYPE(totmail,'W') THEN totmail=1
  3395.     ELSE totmail=totmail+1
  3396.     data.17=WORD(data.17,1)'  'totmail'  'WORD(data.17,3)
  3397.   END
  3398. IF edtype~='MAIL' THEN totwrit.msgdir=totwrit.msgdir+1
  3399. CALL readlines(mailname 1)
  3400. DO ui=1 TO thechosen.0
  3401.   IF thechosen.ui='' THEN ITERATE ui
  3402.   IF ui>1 THEN
  3403.     DO
  3404.       CALL MAKEDIR(bbspath'Email/'thechosen.ui)
  3405.       newname=bbspath'Email/'thechosen.ui'/'name'.'lastwrit+1
  3406.       IF ui<carbons THEN lynes.3='   To:' thechosen.ui
  3407.       ELSE
  3408.         DO
  3409.           lynes.1=lynes.1'  (Carbon Copy)'
  3410.           lynes.3='   To:' thechosen.1
  3411.         END
  3412.       CALL savelines(newname)
  3413.       IF WORDS(lynes.1)>3 & EXISTS(bbspath'EmailFiles/'thechosen.1'/'WORD(lynes.1,4)) THEN
  3414.         DO
  3415.           CALL MAKEDIR(bbspath'EmailFiles/'thechosen.ui)
  3416.           ADDRESS COMMAND 'C:COPY' bbspath'EmailFiles/'thechosen.1'/'WORD(lynes.1,4) bbspath'EmailFiles/'thechosen.ui
  3417.           line2='Copied' WORD(lynes.1,4)
  3418.           SAY line2 'to the' thechosen.ui 'file area.'
  3419.         END
  3420.     END
  3421.   IF edtype~='MAIL' THEN
  3422.     DO
  3423.       IF FIND(userlist,thechosen.ui)>0 THEN
  3424.         CALL msgmark(thechosen.ui msgdir lastwrit+1)
  3425.     END
  3426.   IF GETCLIP('BBS_level')~='' & WORD(GETCLIP('BBS_lastcaller'),1)=thechosen.ui THEN
  3427.     DO
  3428.       temp='new Email.'
  3429.       IF edtype~='MAIL' THEN
  3430.         temp='a new message addressed to you in the'pen3 msg.msgdir def'conference.'
  3431.       oldmess=GETCLIP('BBS_MESSAGE')
  3432.       IF oldmess~='' THEN oldmess=oldmess||'0D0A'x
  3433.       CALL SETCLIP('BBS_MESSAGE',oldmess||'You have' temp)
  3434.     END
  3435.   line=edtype 'Sent To' thechosen.ui
  3436.   IF edtype='MAIL' THEN
  3437.     DO
  3438.       IF emailonline>=0 THEN emailonline=emailonline+1
  3439.     END
  3440.   ELSE
  3441.     DO
  3442.       grand=grand+1
  3443.       IF ~DATATYPE(msg.msgdir.0,'W') THEN msg.msgdir.0=1
  3444.       ELSE msg.msgdir.0=msg.msgdir.0+1
  3445.       line=line 'in the'pen3 msg.msgdir def'conference.'
  3446.     END
  3447.   SAY line
  3448. END
  3449. IF edtype='MAIL' THEN CALL countcheck(bbspath'Numbers/LastMail' lastwrit+1)
  3450. ELSE CALL countcheck(bbspath'Numbers/LastMessage'msgdir lastwrit+1)
  3451. CALL setdir(libpath||dirs.1)
  3452. thechosen.=''
  3453. RETURN 1
  3454.  
  3455.  
  3456. msgmark:
  3457. PARSE ARG markname markdir markmsg .
  3458. IF OPEN(f,bbspath'Users/'markname,'R')=0 THEN RETURN
  3459. mlines.=''
  3460. DO mi=1
  3461.   temp=READLN(f)
  3462.   IF EOF(f) THEN LEAVE mi
  3463.   mlines.mi=STRIP(temp)
  3464. END
  3465. CALL CLOSE(f)
  3466. mlines.0=mi-1
  3467. CALL DELAY(28)
  3468. mlines.24=STRIP(mlines.24 markdir'/'markmsg)
  3469. IF OPEN(f,bbspath'Users/'markname,'W')=0 THEN RETURN
  3470. DO mi=1 TO mlines.0
  3471.   CALL WRITELN(f,mlines.mi)
  3472. END
  3473. CALL CLOSE(f)
  3474. RETURN
  3475.  
  3476.  
  3477. shell:
  3478. SAY
  3479. olddir=PRAGMA('D')
  3480. DO WHILE(UPPER(opt)~='EXIT')
  3481.   SAY bak2||TIME('C')||def PRAGMA('D')
  3482.   OPTIONS PROMPT pen3'Type EXIT to quit AmigaDOS> 'def
  3483.   PARSE PULL opt' 'arg
  3484.   IF(UPPER(opt)='CD') THEN CALL setdir(arg)
  3485.   ELSE IF exists(opt)~=0 THEN
  3486.     DO
  3487.       IF LEFT(STATEF(opt),3)='DIR' THEN CALL setdir(opt)
  3488.     END
  3489.   ELSE IF opt~='' & UPPER(opt)~='EXIT' THEN
  3490.     ADDRESS COMMAND opt '<* >*' arg
  3491. END
  3492. CALL PRAGMA('D',olddir)
  3493. RETURN
  3494.  
  3495.  
  3496. bbsspace:
  3497. ARG tabspace .
  3498. ADDRESS COMMAND 'C:info >ram:locinfout' bbsdevice
  3499. ok=OPEN(f,'ram:locinfout','R')
  3500. IF ok=0 THEN RETURN 20
  3501. line=READLN(f)
  3502. line=READLN(f)
  3503. line=READLN(f)
  3504. line=READLN(f)
  3505. CALL CLOSE(f)
  3506. IF tabspace<14 THEN SAY 
  3507. bbsk=WORD(line,4)
  3508. IF ~DATATYPE(bbsk,'N') THEN
  3509.   DO
  3510.     line=bbsdevice 'is not an info compatible device!'
  3511.     SAY pen3||line||def
  3512.     bbsk=0
  3513.     RETURN
  3514.   END
  3515. bbsk=bbsk*512-SYSTEM_SPACE_LIMIT
  3516. IF bbsk<1 THEN bbsk=0
  3517. SAY RIGHT(comma(bbsk),tabspace) 'bytes available for uploads.'
  3518. RETURN
  3519.  
  3520.  
  3521. comma:
  3522. ARG num .
  3523. dgt=LENGTH(num)
  3524. numtext=''
  3525. IF dgt>3 THEN numtext=','RIGHT(num,3)
  3526. IF dgt>6 THEN numtext=','LEFT(RIGHT(num,6),3)||numtext
  3527. IF dgt>9 THEN numtext=','LEFT(RIGHT(num,9),3)||numtext
  3528. IF dgt>12 THEN
  3529.   DO
  3530.     numtext=','LEFT(RIGHT(num,12),3)||numtext
  3531.     numtext=LEFT(num,dgt-12)||numtext
  3532.   END
  3533. ELSE IF dgt>9 THEN numtext=LEFT(num,dgt-9)||numtext
  3534. ELSE IF dgt>6 THEN numtext=LEFT(num,dgt-6)||numtext
  3535. ELSE IF dgt>3 THEN numtext=LEFT(num,dgt-3)||numtext
  3536. ELSE numtext=num
  3537. RETURN numtext
  3538.  
  3539.  
  3540. is_here:
  3541. ARG newname 
  3542. SAY 'Checking filelist...'
  3543. DO wi=1 TO 99
  3544.   IF wi//3=0 THEN CALL WRITECH(STDOUT,'.')
  3545.   IF dirs.wi='' THEN ITERATE wi
  3546.   IF ~EXISTS(bbspath'FileNotes/'dirs.wi'/'newname) THEN ITERATE wi
  3547.   line=pen3'*** File' newname 'already exists here'
  3548.   IF wi<=level THEN line=line 'in the' dirs.wi 'library'
  3549.   line=line'.'def
  3550.   SAY line
  3551.   SAY 'Original uploader should ['pen3'K'def']ill the file before uploading the replacement.'
  3552.   CALL waiting()
  3553.   RETURN 1
  3554. END
  3555. CALL cleanline(1)
  3556. RETURN 0
  3557.  
  3558.  
  3559. uload:
  3560. ARG frommenu
  3561. CALL bbsspace(12)
  3562. SAY
  3563. IF bbsk<1 THEN
  3564.   DO
  3565.     SAY pen3'Upload area is full!'def
  3566.     RETURN 1
  3567.   END
  3568. IF arg='' THEN
  3569.   DO
  3570.     frompath=GETCLIP('BBS_frompath')
  3571.     IF frompath='' THEN frompath='RAM:'
  3572.     fdir=''
  3573.     DO loop=1
  3574.       fromfile=GetFile(150,36,frompath,'',' Select File to Upload ')
  3575.       IF fromfile='' THEN RETURN 1
  3576.       IF EXISTS(fromfile) THEN LEAVE loop
  3577.       SAY
  3578.       SAY fromfile 'does not exist!'
  3579.     END
  3580.     x=LASTPOS('/',fromfile)
  3581.     IF x=0 THEN x=POS(':',fromfile)
  3582.     IF x>0 THEN
  3583.       DO
  3584.         arg=SUBSTR(fromfile,x+1)
  3585.         fdir=LEFT(fromfile,x)
  3586.         IF RIGHT(fdir,1)='/' THEN fdir=LEFT(fdir,x-1)
  3587.         CALL SETCLIP('BBS_frompath',fdir)
  3588.       END
  3589.     ELSE arg=fromfile
  3590.   END
  3591. ELSE fromfile=PRAGMA('D')'/'arg
  3592. arg=COMPRESS(arg,' :/,;|#?*()+[]"{}')  /* be sure no illegals here */
  3593. x=LASTPOS('/',fromfile)
  3594. IF x=0 THEN x=LASTPOS(':',fromfile)
  3595. IF x>0 THEN
  3596.   DO
  3597.     IF DATATYPE(SUBSTR(fromfile,x+1),'W') THEN
  3598.       DO
  3599.         SAY 'Whole numbers are not allowed as filenames!'
  3600.         CALL waiting()
  3601.         RETURN 1
  3602.       END
  3603.   END
  3604. tempnum=LENGTH(arg)-16
  3605. DO WHILE tempnum>0 & POS('EMAILFILES',UPPER(PRAGMA('D')))=0
  3606.   temp='          'pen3||arg def'is'pen3 tempnum||def
  3607.   IF tempnum=1 THEN temp=temp 'character'
  3608.   ELSE temp=temp 'characters'
  3609.   temp=temp 'too long for a filename.'
  3610.   SAY temp  
  3611.   arg=getinput(0 0 'Filename: ')
  3612.   arg=cleanstring('0:'arg)
  3613.   arg=COMPRESS(arg,' :/,;|#?*')
  3614.   tempnum=LENGTH(arg)-16
  3615. END
  3616. IF arg='' THEN RETURN 1
  3617. IF frommenu THEN
  3618.   DO
  3619.     IF is_here(arg) THEN RETURN 1
  3620.     IF bbsprefs.6=1 & sysoplevel>level THEN CALL setdir(libpath'Sysops')
  3621.     ELSE
  3622.       DO
  3623.         SAY 'Please select an appropriate library for -' pen3||arg def'-'
  3624.         IF chdir()>0 THEN RETURN
  3625.       END
  3626.   END
  3627. ADDRESS COMMAND 'C:COPY' fromfile PRAGMA('D')'/'arg
  3628. IF TestArc.rexx(PRAGMA('D')'/'arg)>0 THEN
  3629.   DO
  3630.     SAY
  3631.     SAY pen3'***'def arg pen3'failed archive check!'def
  3632.     SAY
  3633.     temp=getinput(1 1 'Do you believe the archive checker made a mistake? (Ny) > ')
  3634.     IF temp~='Y' THEN
  3635.       DO
  3636.         CALL DELETE(arg)
  3637.         SAY
  3638.         RETURN 2
  3639.       END
  3640.   END
  3641. IF POS('EMAILFILES',UPPER(PRAGMA('D')))>0 THEN RETURN 0
  3642. DO ui=sysoplevel+2 TO 100
  3643.   IF UPPER(dirs.ui)=UPPER(plaindir) THEN RETURN 0
  3644. END
  3645. IF frommenu THEN
  3646.   DO WHILE editnote(bbspath'FileNotes/'plaindir'/'arg) /* INSIST on a filenote */
  3647.   END
  3648. RETURN 0
  3649.  
  3650.  
  3651. findfiles:
  3652. PARSE ARG ffile .
  3653. IF POS('EMAILFILES',UPPER(PRAGMA('D')))>0 THEN RETURN ffile
  3654. wi=0
  3655. IF DATATYPE(ffile,'W') THEN
  3656.   DO
  3657.     IF WORDS(files.ffile)<2 THEN RETURN 0
  3658.     dirtemp=WORD(files.ffile,1)
  3659.     IF finddirnum(dirtemp)>level | FIND(data.21,UPPER(dirtemp))>0 THEN
  3660.       DO
  3661.         CALL illegal_access()
  3662.         RETURN 0
  3663.       END
  3664.     CALL setdir(libpath||dirtemp)
  3665.   END
  3666. ELSE IF EXISTS(ffile) THEN
  3667.   DO
  3668.     IF EXISTS(bbspath'FileNotes/'plaindir'/'ffile) THEN
  3669.       DO
  3670.         IF readopen(bbspath'FileNotes/'plaindir'/'ffile)~=0 THEN
  3671.           DO
  3672.             line=READLN(f)
  3673.             CALL CLOSE(f)
  3674.             ffile=WORD(line,2)
  3675.           END
  3676.       END
  3677.   END
  3678. ELSE IF EXISTS(bbspath'Information'ffile) THEN
  3679.   RETURN bbspath'Information/'ffile
  3680. ELSE
  3681.   DO
  3682.     nextfilenum=countcheck(bbspath'Numbers/LastFile' 0)+1
  3683.     CALL busywait(4 1)
  3684.     DO ni=nextfilenum TO 0 BY -1
  3685.       IF ni<1 THEN
  3686.         DO
  3687.           CALL busywait(4 0)
  3688.           SAY '***' files.0 'filenames scanned,'pen3 ffile def'was not found!'
  3689.           RETURN 0
  3690.         END
  3691.       IF ni>1 THEN CALL busywait(60 ni nextfilenum)
  3692.       argtemp=WORD(files.ni,2)
  3693.       IF UPPER(argtemp)=UPPER(ffile) THEN
  3694.         DO
  3695.           dirtemp=WORD(files.ni,1)
  3696.           jj=files.ni.0
  3697.           IF WORD(alpha.jj,4)>level | FIND(data.21,UPPER(dirtemp))>0 THEN
  3698.             DO
  3699.               CALL busywait(4 0)
  3700.               CALL illegal_access()
  3701.               RETURN 0
  3702.             END
  3703.           ffile=ni
  3704.           CALL setdir(libpath||dirtemp)
  3705.           LEAVE ni
  3706.         END
  3707.     END
  3708.     CALL busywait(4 0)
  3709.   END
  3710. ftemp=ffile
  3711. IF DATATYPE(ftemp,'W') THEN ftemp=WORD(files.ftemp,2)
  3712. IF ~EXISTS(ftemp) THEN
  3713.   DO
  3714.     finfo=STATEF(bbspath'FileNotes/'plaindir'/'ftemp)
  3715.     IF WORDS(finfo)>7 THEN ftemp=WORD(finfo,8)
  3716.     IF ~EXISTS(ftemp) THEN
  3717.       DO
  3718.         IF finfo='' THEN SAY '***'pen3 PRAGMA('D')'/'ftemp def'was not found!'
  3719.         ELSE
  3720.           DO
  3721.             SAY
  3722.             SAY '***'pen3 plaindir'/'ftemp def'is not currently available online.'
  3723.             SAY 'Please leave email to your sysop'pen3 sysop||def', to receive this file.'
  3724.             SAY
  3725.           END
  3726.         RETURN 0
  3727.       END
  3728.   END
  3729. RETURN ffile
  3730.  
  3731.  
  3732. illegal_access:
  3733. SAY
  3734. SAY '*** You are not authorized to access' ffile'!'
  3735. SAY '*** Send Email to' sysop 'to receive a higher level.'
  3736. SAY
  3737. RETURN
  3738.  
  3739.  
  3740. ext_dload:
  3741. SAY
  3742. arg=bbsExtDL.baud(name level TRUNC(maxtime-TIME('E')) linesperpage colorflag extdevs)
  3743. IF arg~='' THEN SAY 'Sorry, LOCAL mode cannot download from the Extra Devices.'
  3744. RETURN
  3745.  
  3746.  
  3747. dload:
  3748. arg=STRIP(arg data.25)
  3749. data.25=''
  3750. errorflag=0
  3751. curdir=PRAGMA('D')
  3752. OPTIONS PROMPT 'File numbers (and/or names): '
  3753. IF arg='' THEN PARSE PULL arg  /* no filename given */
  3754. IF arg='' THEN RETURN 0
  3755. IF findfiles(arg)=0 THEN RETURN 0
  3756. arg=TRANSLATE(arg,'     ',':/,;|')
  3757. IF WORDS(arg)>1 THEN arg=WORD(arg,1)
  3758. IF DATATYPE(arg,'W') THEN
  3759.   DO
  3760.     CALL setdir(libpath||WORD(files.arg,1))
  3761.     arg=WORD(files.arg,2)
  3762.   END
  3763. IF arg~='' THEN           /* check for filename */
  3764.   DO dloadloop=1
  3765.     frompath=GETCLIP('BBS_frompath')
  3766.     IF frompath='' THEN frompath=libpath'SysOps/'
  3767.     notename=bbspath'FileNotes/'plaindir'/'arg
  3768.     IF ~EXISTS(arg) THEN
  3769.       DO
  3770.         finfo=STATEF(notename)
  3771.         IF WORDS(finfo)>7 THEN
  3772.           DO
  3773.             temp=plaindir
  3774.             x=lastslash(WORD(finfo,8))
  3775.             arg=WORD(x,1)
  3776.             CALL setdir(WORD(x,2))
  3777.             plaindir=temp
  3778.           END
  3779.       END
  3780.     topath=PRAGMA('D')
  3781.     num=LASTPOS('/',arg)
  3782.     IF num=0 THEN num=LASTPOS(':',arg)
  3783.     IF num>0 THEN
  3784.       DO
  3785.         topath=LEFT(arg,num)
  3786.         arg=SUBSTR(arg,num+1)
  3787.       END
  3788.     IF RIGHT(topath,1)~=':' & RIGHT(topath,1)~='/' THEN topath=topath'/'
  3789.     SAY ' Select Filename to Copy ' topath||arg 'To:'
  3790.     tofile=GetFile(150,36,frompath,arg,' Select Destination Name ')
  3791.     IF tofile='' THEN
  3792.       DO
  3793.         errorflag=1
  3794.         LEAVE dloadloop
  3795.       END
  3796.     ADDRESS COMMAND 'C:Copy' topath||arg tofile
  3797.     CALL SETCLIP('BBS_frompath',WORD(lastslash(tofile),2))
  3798.     IF POS('EMAILFILES',UPPER(PRAGMA('D')))>0 THEN LEAVE dloadloop
  3799.     DO di=sysoplevel+2 TO 100
  3800.       IF UPPER(dirs.di)=UPPER(plaindir) THEN LEAVE dloadloop
  3801.     END
  3802.     IF readlines(notename 1) THEN LEAVE dloadloop
  3803.     dls=WORD(lynes.2,7)
  3804.     IF ~DATATYPE(dls,'W') THEN dls=0
  3805.     lynes.2=STRIP(DELWORD(lynes.2,7,1)) dls+1
  3806.     finfo=STATEF(notename)
  3807.     IF WORDS(finfo)>7 THEN finfo=SUBSTR(finfo,WORDINDEX(finfo,8))
  3808.     ELSE finfo=''
  3809.     CALL DELETE(notename)
  3810.     CALL savelines(notename)
  3811.     CALL DELAY(28)
  3812.     IF finfo~='' THEN ADDRESS COMMAND 'C:FileNote' notename finfo
  3813.     LEAVE dloadloop
  3814.   END
  3815. CALL setdir(curdir)
  3816. IF errorflag THEN SAY pen3'*** Download Failed!'def
  3817. RETURN errorflag
  3818.  
  3819.  
  3820. lastslash:
  3821. PARSE ARG sarg 
  3822. sdir=''
  3823. slash=LASTPOS('/',sarg)
  3824. IF slash>2 THEN sdir=LEFT(sarg,slash-1)
  3825. ELSE
  3826.   DO
  3827.     slash=LASTPOS(':',sarg)
  3828.     IF slash>0 THEN sdir=LEFT(sarg,slash)
  3829.   END
  3830. IF slash>0 THEN sarg=SUBSTR(sarg,slash+1)
  3831. RETURN sarg sdir
  3832.  
  3833.  
  3834. editnote:
  3835. IF arg='' THEN
  3836.   DO
  3837.     PARSE PULL arg .
  3838.     IF arg='' THEN RETURN 0
  3839.   END
  3840. comment=''
  3841. IF ~EXISTS(arg) THEN
  3842.   DO
  3843.     finfo=STATEF(bbspath'FileNotes/'plaindir'/'arg)
  3844.     fromarg=arg
  3845.     fromdir=GETCLIP('BBS_frompath')
  3846.     IF WORDS(finfo)>7 THEN
  3847.       DO
  3848.         temp='Y'
  3849.         fromdir=WORD(finfo,8)
  3850.         fromdir=lastslash(fromdir)
  3851.         fromarg=WORD(fromdir,1)
  3852.         fromdir=WORD(fromdir,2)
  3853.       END
  3854.     ELSE
  3855.       DO
  3856.         IF level<sysoplevel THEN RETURN 0
  3857.         temp=getinput(1 1 'Is this file on an another device? (Nqy)')
  3858.       END
  3859.     IF fromdir='' THEN fromdir='RAM:'
  3860.     IF temp='Y' THEN
  3861.       DO WHILE comment=''
  3862.         comment=GetFile(150,36,fromdir,fromarg,' Select Linked File ')
  3863.         IF comment='' THEN RETURN 0
  3864.         IF ~EXISTS(comment) THEN comment=''
  3865.         ELSE CALL SETCLIP('BBS_frompath',WORD(lastslash(comment),2))
  3866.       END
  3867.     ELSE IF temp~='N' THEN RETURN 0
  3868.   END
  3869. IF comment='' THEN
  3870.   DO
  3871.     arg=findfiles(arg)
  3872.     IF arg=0 THEN RETURN 0
  3873.     IF DATATYPE(arg,'W') THEN arg=WORD(files.arg,2)
  3874.   END
  3875. filedir=plaindir
  3876. slash=LASTPOS('/',arg)
  3877. IF slash=0 THEN slash=LASTPOS(':',arg)
  3878. IF slash>0 THEN
  3879.   DO
  3880.     filedir=LEFT(arg,slash-1)
  3881.     filedir=SUBSTR(filedir,5)
  3882.     arg=SUBSTR(arg,slash+1)
  3883.   END
  3884. ELSE filedir=plaindir
  3885. CALL MAKEDIR(bbspath'FileNotes/'filedir)
  3886. IF ~EXISTS(bbspath'FileNotes/'filedir) THEN
  3887.   DO
  3888.     SAY pen3'*** Failed to open directory!' filedir||def
  3889.     RETURN 0
  3890.   END
  3891. notename=bbspath'FileNotes/'filedir'/'arg
  3892. lynes.=''
  3893. filenum=countcheck(bbspath'Numbers/LastFile' 0)
  3894. IF level>sysoplevel THEN firstedit=1
  3895. ELSE firstedit=5
  3896. IF EXISTS(notename) THEN
  3897.   DO
  3898.     IF comment~='' THEN ADDRESS COMMAND 'C:filenote' notename comment
  3899.     CALL bbsED(firstedit notename)
  3900.     RETURN 0
  3901.   END
  3902. IF comment='' THEN filedata=STATEF(libpath||filedir'/'arg)
  3903. ELSE filedata=STATEF(comment)
  3904. IF filedata='' THEN
  3905.   DO
  3906.     IF comment='' THEN line=filedir'/'arg
  3907.     ELSE line=comment
  3908.     SAY line 'does not exist!'
  3909.     RETURN 0
  3910.   END
  3911. bytes=WORD(filedata,2)
  3912. filenum=filenum+1
  3913. lynes.0=4
  3914. lynes.1='File: 'LEFT(filenum,5)' KeyWords:'
  3915. lynes.2='Name: 'LEFT(arg,27)' Size: 'bytes' bytes   Downloads: 0'
  3916. lynes.3='From: 'LEFT(name,27)' Date: 'DATE() TIME('C')'  Lib: 'filedir
  3917. lynes.4=LEFT('',74,'=')
  3918. lynes.1=lynes.1 edkeywords(arg filedir)
  3919. CALL seelines(1)
  3920. edtype=''
  3921. CALL writebuffer(scratch'/NoteLOCAL')
  3922. IF savelines(notename) THEN RETURN 0
  3923. IF comment~='' THEN ADDRESS COMMAND 'C:filenote' notename comment
  3924. fncom='R'
  3925. DO WHILE fncom='R'
  3926.   CALL seelines(1)
  3927.   nonstop=0
  3928.   line='['pen3'E'def']dit'
  3929.   IF level>sysoplevel THEN line=line '['pen3'K'def']ill'
  3930.   line=line '['pen3'R'def']ead ['pen3'S'def']ave'
  3931.   IF level>sysoplevel THEN line=line '(ekrS) 'def
  3932.   ELSE line=line '(erS) 'def
  3933.   fncom=getinput(1 1 line)
  3934.   IF fncom='K' & level>sysoplevel THEN
  3935.     DO
  3936.       SAY 'Killing FileNote..'
  3937.       CALL DELETE(notename)
  3938.       RETURN 1
  3939.     END
  3940.   ELSE IF fncom='E' THEN
  3941.     DO
  3942.       IF bbsED(firstedit notename)>0 THEN RETURN 0
  3943.       fncom='R'
  3944.     END
  3945.   ELSE IF fncom~='R' THEN
  3946.     DO
  3947.       SAY 'Adjusting filelist...'
  3948.       IF filenum<1 THEN filenum=1
  3949.       IF GETCLIP('BBS_level')~='' THEN CALL SETCLIP('BBS_localfiles',1)
  3950.       CALL countcheck(bbspath'Numbers/LastFile' filenum)
  3951.       files.0=files.0+1
  3952.       newcount=alpha.0+1
  3953.       alpha.0=newcount
  3954.       files.filenum=plaindir arg
  3955.       files.filenum.0=newcount
  3956.       libnum=finddirnum(plaindir)
  3957.       PARSE VAR lynes.1 . 'KeyWords:' keywords
  3958.       alpha.newcount=LEFT(arg,22-LENGTH(WORD(lynes.2,4)))
  3959.       alpha.newcount=alpha.newcount WORD(lynes.2,4) RIGHT(filenum,5)
  3960.       alpha.newcount=alpha.newcount RIGHT(libnum,2) LEFT(plaindir,12)
  3961.       alpha.newcount=alpha.newcount STRIP(LEFT(STRIP(keywords),32))
  3962.       IF EXISTS(bbspath'Lists/Files') THEN
  3963.         x=OPEN(f,bbspath'Lists/Files','A')
  3964.       ELSE x=OPEN(f,bbspath'Lists/Files','W')
  3965.       IF x=0 THEN
  3966.         DO
  3967.           SAY '*** Failed to open' bbspath'Lists/Files'
  3968.           RETURN 0
  3969.         END
  3970.       CALL WRITELN(f,filenum files.filenum)
  3971.       CALL CLOSE(f)
  3972.       IF EXISTS(bbspath'Lists/Files.ALPHA') THEN
  3973.         x=OPEN(f,bbspath'Lists/Files.ALPHA','A')
  3974.       ELSE x=OPEN(f,bbspath'Lists/Files.ALPHA','W')
  3975.       IF x=0 THEN
  3976.         DO
  3977.           SAY '*** Failed to open' bbspath'Lists/Files.ALPHA'
  3978.           RETURN 0
  3979.         END
  3980.       CALL WRITELN(f,alpha.newcount)
  3981.       CALL CLOSE(f)
  3982.       sortalphaflag=1
  3983.       savefileflag=1
  3984.     END
  3985. END
  3986. RETURN 0
  3987.  
  3988.  
  3989. edkeywords:
  3990. PARSE ARG kwarg
  3991. templine=''
  3992. DO WHILE LENGTH(templine)<3
  3993.   SAY
  3994.   SAY pen3'Please enter a list of keywords (or a condensed description)'def
  3995.   SAY pen3'to be used in the alphabetic list and by the search routine.'def
  3996.   SAY '    Note that only the first 32 characters will be used.'
  3997.   SAY LEFT('',43)'|'LEFT('',31,'=')'|'
  3998.   templine=getinput(0 0 ' 'RIGHT(STRIP(RIGHT(kwarg,32)),32) pen3'KeyWords: 'def)
  3999.   templine=cleanstring('0:'templine)
  4000.   templine=STRIP(LEFT(templine,32))
  4001.   SAY
  4002. END
  4003. RETURN templine
  4004.  
  4005.  
  4006. loadfiles:
  4007. SAY def
  4008. SAY 'Loading filelist...'
  4009. files.=''
  4010. files.0=0
  4011. IF readopen(bbspath'Lists/Files') THEN
  4012.   DO
  4013.     DO i=1
  4014.       line=READLN(f)
  4015.       IF EOF(f) THEN BREAK
  4016.       num=WORD(line,1)
  4017.       IF DATATYPE(num,'W') THEN files.num=WORD(line,2) WORD(line,3)
  4018.     END
  4019.     files.0=i-1
  4020.     CALL CLOSE(f)
  4021.   END
  4022. RETURN
  4023.  
  4024.  
  4025. savefilelist:
  4026. IF level=99 THEN
  4027.   IF getinput(1 1 'Update filelists now? (nY) > ')='N' THEN RETURN
  4028.  
  4029. savefilelist2:
  4030. SIGNAL OFF BREAK_E
  4031. IF ckmaint('FILES') THEN RETURN
  4032. CALL savealphalist()
  4033. SAY 'Saving filelist...'
  4034. CALL SETCLIP('BBS_maint',1)
  4035. xarg=bbspath'Lists/Files'
  4036. CALL DELETE(xarg)
  4037. filenum=countcheck(bbspath'Numbers/LastFile' 0)
  4038. IF filenum<1 | writeopen(xarg)=0 THEN RETURN
  4039. DO i=1 TO filenum
  4040.   IF files.i='' THEN ITERATE
  4041.   CALL WRITELN(f,i files.i)
  4042. END
  4043. CALL CLOSE(f)
  4044. CALL SETCLIP('BBS_maint')
  4045. savefileflag=0
  4046. IF SHOW('P','BBBBS') THEN CALL SETCLIP('BBS_localfiles',2)
  4047. RETURN
  4048.  
  4049.  
  4050. loadalpha:
  4051. SAY def
  4052. SAY 'Loading the alphabetical filelist...'
  4053. IF readopen(bbspath'Lists/Files.ALPHA') THEN
  4054.   DO
  4055.     alpha.=''
  4056.     alpha.0=0
  4057.     DO i=1
  4058.       line=READLN(f)
  4059.       IF EOF(f) THEN LEAVE i
  4060.       fnum=WORD(line,3)
  4061.       IF DATATYPE(fnum,'W') THEN
  4062.         DO
  4063.           alpha.i=line
  4064.           files.fnum.0=i
  4065.         END
  4066.       ELSE i=i-1
  4067.     END
  4068.     CALL CLOSE(f)
  4069.     tf=bbspath'Lists/Files.ALPHA.add'
  4070.     IF EXISTS(tf) & ~SHOW('P','BBSFILE') THEN
  4071.       IF readopen(tf) THEN
  4072.         DO
  4073.           DO i=i
  4074.             line=READLN(f)
  4075.             IF EOF(f) THEN LEAVE i
  4076.             fnum=WORD(line,3)
  4077.             IF DATATYPE(fnum,'W') THEN
  4078.               DO
  4079.                 alpha.i=line
  4080.                 files.fnum.0=i
  4081.               END
  4082.             ELSE i=i-1
  4083.           END
  4084.           CALL CLOSE(f)
  4085.           CALL DELETE(tf)
  4086.         END
  4087.     alpha.0=i-1
  4088.   END
  4089. ELSE SAY pen3'*** Lists/Files.ALPHA failed to open for reading!'def
  4090. SAY
  4091. RETURN
  4092.  
  4093.  
  4094. ckmaint:
  4095. ARG ckfile .
  4096. IF GETCLIP('BBS_maint')~='' THEN
  4097.   DO
  4098.     DO i=0 TO 23 WHILE GETCLIP('BBS_maint')~=''
  4099.       IF i//2=0 THEN SAY 'Waiting' (24-i)*5 'more seconds for' ckfile 'list update to finish...'
  4100.       CALL DELAY(250)
  4101.     END
  4102.     IF i>23 THEN
  4103.       DO
  4104.         SAY '*** unable to update' ckfile 'list.'
  4105.         RETURN 1
  4106.       END
  4107.   END
  4108. RETURN 0
  4109.  
  4110.  
  4111. savealphalist:
  4112. SIGNAL OFF BREAK_E
  4113. IF ckmaint('ALPHA') THEN RETURN
  4114. CALL SETCLIP('BBS_maint',1)
  4115. IF GETCLIP('BBS_mainfiles')~='' & GETCLIP('BBS_maint')='' THEN
  4116.   DO
  4117.     CALL SETCLIP('BBS_mainfiles')
  4118.     CALL loadfiles()
  4119.     CALL loadalpha()
  4120.   END
  4121. aarg=bbspath'Lists/Files.ALPHA'
  4122. CALL DELETE(aarg)
  4123. IF sortalphaflag=1 THEN
  4124.   DO
  4125.     SAY 'Alphabetizing' alpha.0 'files...'
  4126.     IF alpha.0>0 THEN CALL QSORT(1,alpha.0,alpha)
  4127.     DO i=1 TO alpha.0
  4128.       fnum=WORD(alpha.i,3)
  4129.       files.fnum.0=i
  4130.     END
  4131.   END
  4132. sortalphaflag=0
  4133. IF writeopen(aarg)=0 THEN
  4134.   DO
  4135.     SAY '*** Error opening' aarg '!'
  4136.     CALL SETCLIP('BBS_maint')
  4137.     RETURN
  4138.   END
  4139. SAY 'Saving alphabetical filelist...'
  4140. DO i=1 TO alpha.0
  4141.   ii=WORD(alpha.i,3)
  4142.   IF files.ii='' THEN alpha.i='0 0' ii '100'
  4143.   IF LEFT(alpha.i,4)~='0 0 ' THEN CALL WRITELN(f,alpha.i)
  4144. END
  4145. CALL CLOSE(f)
  4146. CALL SETCLIP('BBS_maint')
  4147. CALL bbsALPHA.rexx SUBSTR(extension,2) arccom
  4148. RETURN
  4149.  
  4150.  
  4151. viewuser:
  4152. SAY 
  4153. SAY bak2' 'name' 'def
  4154. DO i=1 TO 18
  4155.   stuff=data.i
  4156.   IF i=13 | i=14 THEN stuff=DATE(,data.i,'S')
  4157.   SAY RIGHT(i,2)||pen3 text.i||def':' stuff
  4158. END
  4159. CALL waiting()
  4160. RETURN
  4161.  
  4162.  
  4163. edituser:
  4164. IF level>0 THEN
  4165.   IF getinput(1 1 'Change ['pen3'U'def']ser data or ['pen3'M'def']essage conference access (mU) > ')='M' THEN
  4166.     DO
  4167.       SAY
  4168.       SAY pen3'     - Message Conference Access -'def
  4169.       SAY '[O]ff turns all message conferences OFF.'
  4170.       SAY 'Set the last message read by you in ALL message conferences'
  4171.       temp=getinput(1 1 ' ['pen3'F'def']irst  ['pen3'L'def']ast  ['pen3'O'def']ff  ['pen3'Q'def']uit  (floQ) > ')
  4172.       IF temp~='F' & temp~='O' & temp~='L' THEN RETURN
  4173.       SAY 'Resetting...'lineup
  4174.       data.22=''
  4175.       DO i=1 TO level
  4176.         IF temp='F' THEN num=0
  4177.         ELSE IF temp='O' THEN num=-1
  4178.         ELSE num=countcheck(bbspath'Numbers/LastMessage'i 0)
  4179.         data.22=data.22 num
  4180.       END
  4181.       CALL SetData()
  4182.       CALL sortconferences()
  4183.       CALL savedata(1)
  4184.       RETURN
  4185.     END
  4186. new=0
  4187. change=0
  4188. edata.=''
  4189. edname=name
  4190. DO i=0 TO data.0
  4191.   edata.i=data.i
  4192. END
  4193. num=1
  4194. DO WHILE num~='' | edname~=name
  4195.   IF num='' | LEFT(num,1)='Q' THEN
  4196.     DO
  4197.       IF change THEN
  4198.         DO
  4199.           CALL SetData()
  4200.           CALL saveData(1)
  4201.           change=0
  4202.         END
  4203.       IF new THEN
  4204.         DO
  4205.           data.=''
  4206.           DO i=0 TO edata.0
  4207.             data.i=edata.i
  4208.           END
  4209.           name=edname
  4210.           new=0
  4211.         END
  4212.       CALL SetData()
  4213.     END
  4214.   maxnum=10
  4215.   IF edata.20>sysoplevel THEN maxnum=20
  4216.   IF edata.20=99 THEN maxnum=24
  4217.   SAY bak2' 'name' 'def
  4218.   maxlines=21
  4219.   IF maxnum=10 THEN maxlines=20
  4220.   DO i=1 TO maxlines
  4221.     IF i=5 & name~=edname & edata.20<99 THEN ITERATE
  4222.     SAY RIGHT(i,2)||pen3 text.i||def':' data.i
  4223.   END
  4224.   IF edata.20>sysoplevel THEN
  4225.     DO
  4226.       line=LEFT(' ',50)
  4227.       IF name=edname THEN line=line'NEW = Change User.'
  4228.       line=pen3||line||def||lineup
  4229.       SAY line
  4230.     END
  4231.   num=getinput(1 0 'Select Line Number To Edit: ')
  4232.   IF num='NEW' & edata.20>sysoplevel & edname=name THEN    /* select a new user */
  4233.     DO
  4234.       new=1
  4235.       IF change THEN
  4236.         DO
  4237.           CALL SetData()
  4238.           CALL saveData(1)
  4239.         END
  4240.       change=0
  4241.       nufile=bbspath'Lists/NEW_USERS'
  4242.       IF EXISTS(nufile) THEN
  4243.         IF ~readlines(nufile 1) THEN CALL seelines(0)
  4244.       savename=name
  4245.       name=getinput(1 0 'New User Name: 'def)
  4246.       name=SPACE(name,1,'_')
  4247.       name=COMPRESS(name,':/*#?^')
  4248.       IF loadData()=0 THEN name=savename
  4249.       IF data.20>=edata.20 THEN
  4250.         DO
  4251.           SAY 'Can''t Edit!' pen3||name def'has an equal or higher level than thee.'
  4252.           name=savename
  4253.           CALL loadData()
  4254.         END
  4255.     END
  4256.   ELSE IF DATATYPE(num,'W') & num>0 THEN
  4257.     DO
  4258.       IF num>maxnum THEN
  4259.         DO
  4260.           SAY 
  4261.           SAY pen3'You are not authorized to change that information!'def
  4262.           SAY 
  4263.         END
  4264.       ELSE
  4265.         DO dummy=1 TO 1
  4266.           IF num=8 THEN
  4267.             DO
  4268.               SAY
  4269.               SAY 'Use spaces to seperate options.'
  4270.               SAY 'If the option word is in line 8, it is ON.'
  4271.               SAY 'Valid Options:'
  4272.               SAY '        CLEAR  clears screen between pages.'
  4273.               SAY '        COLOR  turns ANSI color codes ON.'
  4274.               SAY '        MENU   combines all main commands into 1 menu.'
  4275.               SAY '        MENUS  splits main commands into 3 menus.'
  4276.               SAY '        PHONE  makes your phone number public.'
  4277.               SAY '        QUICK  activates offline options. See bbsQUICK.DOC'
  4278.               SAY '        STREET makes your street address public.'
  4279.               SAY '        TERSE  skips some of the logon procedures.'
  4280.               SAY
  4281.             END
  4282.           line=RIGHT(num,2)||pen3 text.num||def': '
  4283.           SAY line||data.num
  4284.           temp=getinput(0 0 line)
  4285.           IF temp='' THEN
  4286.             DO
  4287.               IF num=1 | num=4 | num=5 | num=6 | num=7 THEN LEAVE dummy
  4288.               IF num=11 | num=12 | num=13 | num=20 THEN LEAVE dummy
  4289.             END
  4290.           IF num=5 | num=8 THEN temp=UPPER(temp)
  4291.           IF num=20 & DATATYPE(temp,'W') & temp>=edata.20 THEN
  4292.             temp=data.20
  4293.           IF edata.20>sysoplevel & name~=edname THEN line2=name' '
  4294.           ELSE line2=''
  4295.           IF num=21 & name=edname & edata.20<99 THEN LEAVE dummy
  4296.           line=text.num':' data.num pen6'CHANGED TO'def temp
  4297.           data.num=temp
  4298.           SAY line
  4299.           SAY 
  4300.           change=1
  4301.         END
  4302.     END
  4303. END
  4304. IF change THEN
  4305.   DO
  4306.     CALL SetData()
  4307.     CALL saveData(1)
  4308.   END
  4309. RETURN
  4310.  
  4311.  
  4312. getnumber:
  4313. PARSE ARG tprompt
  4314. tnum=getinput(1 0 '  'tprompt' > ')
  4315. mask=COMPRESS(XRANGE(),'0123456789')
  4316. tnum=COMPRESS(tnum,mask)
  4317. IF ~DATATYPE(tnum,'W') THEN tnum=0
  4318. tnum=tnum%1
  4319. IF tnum>0 & tnum<10 THEN tnum='0'tnum
  4320. RETURN tnum
  4321.  
  4322.  
  4323. getbirth:
  4324. data.12=WORD(data.12,1)'  'WORD(data.12,2)'  Birthday:'
  4325. SAY pen3'Please enter your birthday.'def
  4326. month=getnumber('Enter the MONTH you were born: (1-12)')
  4327. day=getnumber('Enter the DAY   you were born: (1-31)')
  4328. year=getnumber('Enter the YEAR  you were born:       ')
  4329. IF year<100 THEN year=year+1900
  4330. born=year||month||day
  4331. IF born<18750101 | born>(DATE('S')-50000) THEN
  4332.   DO
  4333.     born=''
  4334.     IF getinput(1 1 'Would you rather skip this question? (Ny) > ')~='Y' THEN
  4335.       CALL getbirth()
  4336.   END
  4337. data.12=WORD(data.12,1)'  'WORD(data.12,2)'  'WORD(data.12,3)' 'WORD(born,1)
  4338. RETURN
  4339.  
  4340.  
  4341. getname:
  4342. nonstop=0
  4343. CALL showuserlist()
  4344. SAY
  4345. pline='Please enter your full Email name : '
  4346. name=getinput(1 0 pline)
  4347. name=cleanstring(1':'name)
  4348. IF name='' THEN
  4349.   DO
  4350.     SAY 'No name, no entry.  Bye!'
  4351.     SIGNAL DONE
  4352.   END
  4353. IF FIND(userlist,name)>0 | FIND(exclusion,name)>0 THEN
  4354.   DO
  4355.     SAY 'Sorry! That name is taken. Please try again.'
  4356.     RETURN 1
  4357.   END
  4358. IF getinput(1 1 'Your name on' bbsname 'will be :' name ', is that correct? (nY) > ')='N' THEN
  4359.   RETURN 1
  4360. RETURN 0
  4361.  
  4362.  
  4363. /** see if name is in data */
  4364.  
  4365. checkUser:
  4366. tries=0
  4367. IF name='NEW' THEN
  4368.   DO
  4369.     name=''
  4370.     DO WHILE getname()
  4371.     END
  4372.   END
  4373. IF FIND(userlist,name)=0 THEN
  4374.   DO
  4375.     IF EXISTS(bbspath'BBS_TEXT/NEW') THEN
  4376.       DO
  4377.         nonstop=0
  4378.         CALL readlines(bbspath'BBS_TEXT/NEW' 1)
  4379.         CALL seelines(0)
  4380.         CALL waiting()
  4381.       END
  4382.     SAY
  4383.     defile=bbspath'BBS_TEXT/DEF.NEW_USER'
  4384.     CALL loadcourtesy()
  4385.     wordnum=FIND(courtesy,name)
  4386.     IF wordnum>0 THEN
  4387.       DO
  4388.         SAY name', is on the Courtesy List. You will be granted immediate access.'
  4389.         courtesy=STRIP(DELWORD(courtesy,wordnum,1))
  4390.         IF writeopen(bbspath'Lists/Courtesy') THEN
  4391.           DO
  4392.             DO i=1 TO WORDS(courtesy)
  4393.               CALL WRITELN(f,WORD(courtesy,i))
  4394.             END
  4395.             CALL CLOSE(f)
  4396.           END
  4397.         defile=bbspath'BBS_TEXT/DEF.COURTESY'
  4398.       END
  4399.     ELSE IF bbsprefs.7=0 THEN SAY name', You have new user access.'
  4400.     IF readlines(defile 1) THEN SIGNAL DONE
  4401.     data.=''
  4402.     data.0=27
  4403.     DO i=6 TO 22
  4404.       data.i=lynes.i
  4405.     END
  4406.     data.12=DATE('S')'  'TIME('C')
  4407.     data.13=data.12
  4408.     lastondate=DATE('I')-1
  4409.     lastontime=TIME('C')
  4410.     DO i=60 TO 2 BY -1
  4411.       SAY RIGHT('- 'i' -',14)
  4412.     END
  4413.     data.7=getinput(1 0 'What number is now at the top of your screen? > ')
  4414.     IF data.7<17 | data.7>75 THEN data.7=20
  4415.     SAY 'Please enter the password you would like to use here.'
  4416.     data.5=getinput(1 0 'Enter Password: ')
  4417.     DO WHILE getinput(1 1 'Your password on' bbsname 'will be :' data.5 ', is that correct? (nY) > ')='N'
  4418.       data.5=getinput(1 0 'Enter Password: ')
  4419.     END
  4420.     IF data.5='' THEN
  4421.       DO
  4422.         line=name 'refused to enter a password.'
  4423.         SIGNAL DONE
  4424.       END
  4425.     data.1=''
  4426.     DO WHILE data.1=''
  4427.       data.1=getinput(0 0 'Full (real) Name: ')
  4428.       IF data.1='' THEN SAY 'You MUST leave your real name!'
  4429.     END
  4430.     data.2=getinput(0 0 'Street: ')
  4431.     data.3=getinput(0 0 'City, State Zip: ')
  4432.     data.4=''
  4433.     DO WHILE data.4=''
  4434.       data.4=getinput(0 0 'Voice Phone (including areacode): ')
  4435.       IF data.4='' THEN
  4436.         SAY sysop 'MUST be able to reach you by phone to validate you!'
  4437.     END
  4438.     CALL getbirth()
  4439.     IF bbsprefs.8 THEN
  4440.       DO
  4441.         newufile=bbspath'Lists/NEW_USERS'
  4442.         IF EXISTS(newufile) THEN ok=OPEN(f,newufile,'A')
  4443.         ELSE
  4444.           DO
  4445.             ok=OPEN(f,newufile,'W')
  4446.             IF ok~=0 THEN CALL WRITELN(f,'*** New Users ***')
  4447.           END
  4448.         IF ok~=0 THEN
  4449.           DO
  4450.             temp=RIGHT(TIME('C'),7) COMPRESS(DATE())
  4451.             temp=temp LEFT(name,24)'=' data.1 data.4
  4452.             CALL WRITELN(f,temp) 
  4453.           END
  4454.         CALL CLOSE(f)
  4455.       END
  4456.     data.9=getinput(0 0 'Computer: ')
  4457.     data.10=getinput(0 0 'Interests: ')
  4458.     test=getinput(1 1 pen3'Do you want other users to see your STREET address? (Ny) > 'def)
  4459.     IF test='Y' THEN data.8=data.8 'STREET'
  4460.     test=getinput(1 1 pen3'Do you want other users to see your PHONE number? (Ny) > 'def)
  4461.     IF test='Y' THEN data.8=data.8 'PHONE'
  4462.     IF bbsprefs.7>0 THEN
  4463.       DO
  4464.         data.20=bbsprefs.7
  4465.         CALL do_eleven(60 bbsprefs.16 bbsprefs.16-1)
  4466.       END
  4467.     SAY
  4468.     CALL SetData()
  4469.     IF data.20=0 THEN
  4470.       SAY 'Thank you, the sysop will give you higher access soon.'
  4471.     ELSE IF bbsprefs.25=1 THEN
  4472.       DO
  4473.         data.22=''
  4474.         data.23=''
  4475.         SAY
  4476.         SAY 'Setting message counters to last 10 messages in each conference...'
  4477.         DO i=1 TO level
  4478.           num=countcheck(bbspath'Numbers/LastMessage'i 0)-10
  4479.           IF num<0 | msg.i.0<10 THEN num=0
  4480.           lastread.i=num
  4481.           data.22=data.22 num
  4482.           data.23=data.23 0
  4483.         END
  4484.         SAY 'Setting file counter to last file uploaded...'
  4485.         lastbrowse=countcheck(bbspath'Numbers/LastFile' 0)
  4486.         newfilesdate=DATE('S') TIME()
  4487.       END
  4488.     SAY
  4489.     SAY 'Please feel free to leave additional info by using [C]omment.'
  4490.     SAY
  4491.     CALL saveData(1)
  4492.     SAY 'Adding' name 'to the user list...'
  4493.     newpassword=data.5
  4494.     sortuserflag=1
  4495.     temp=countcheck(bbspath'Numbers/Users' 0)+1
  4496.     CALL countcheck(bbspath'Numbers/Users' temp)
  4497.     CALL DELETE(bbspath'Lists/USERS')
  4498.   END
  4499. ELSE
  4500.   DO
  4501.     IF loadData()=0 THEN SIGNAL DONE
  4502.     PARSE VAR data.11 amins . . . ttimes . . . atimes .
  4503.     lastondate=DATE('I',WORD(data.13,1),'S')
  4504.     lastontime=WORD(data.13,2)
  4505.     IF DATE('I')>lastondate | level>=sysoplevel THEN atimes=ttimes
  4506.     IF level=99 THEN amins=120
  4507.     data.13=DATE('S')'  'TIME()
  4508.     CALL do_eleven(amins ttimes atimes-1)
  4509.     passprompt='Enter Password: '
  4510.     DO tries=1 TO 3
  4511.       OPTIONS PROMPT passprompt
  4512.       PULL newpassword
  4513.       SAY ''
  4514.       IF(password=newpassword) THEN LEAVE tries; /* correct password */
  4515.       IF tries=3 THEN
  4516.         DO
  4517.           SAY 
  4518.           SAY 'Access terminated.'
  4519.           line='*** Bad password ***' newpassword '***'
  4520.           SAY line
  4521.           SIGNAL OUT2
  4522.         END
  4523.       SAY lineup'                                 '
  4524.       passprompt='Incorrect.  Password: ' /* ask again */
  4525.     END
  4526.   END
  4527. CALL DELAY(14)
  4528. SAY 
  4529. RETURN
  4530.  
  4531.  
  4532. do_eleven:
  4533. ARG am tc at .
  4534. data.11=am 'minutes per call,' tc 'calls per day,'
  4535. data.11=data.11 at 'more calls today'
  4536. RETURN
  4537.  
  4538.  
  4539. saveData:
  4540. ARG messflag .
  4541. IF data.5='' THEN RETURN
  4542. SAY 'Updating...             'lineup
  4543. IF newfilesdate~='' THEN data.16=lastbrowse newfilesdate
  4544. ELSE IF lastbrowse>0 THEN
  4545.   DO
  4546.     IF WORDS(data.16)>1 THEN data.16=DELWORD(data.16,1,1)
  4547.     ELSE data.16=DATE('S') TIME()
  4548.     data.16=lastbrowse data.16
  4549.   END
  4550. IF messflag THEN
  4551.   DO
  4552.     userexclude.=0
  4553.     DO si=1 TO WORDS(data.22)
  4554.       IF WORD(data.22,si)=-1 THEN userexclude.si=1
  4555.     END
  4556.     data.22=''
  4557.     data.23=''
  4558.     DO si=1 TO 99
  4559.       IF ~DATATYPE(lastread.si,'W') THEN lastread.si=0
  4560.       IF userexclude.si THEN data.22=data.22 '-1'
  4561.       ELSE data.22=data.22 lastread.si
  4562.       IF ~DATATYPE(totwrit.si,'W') THEN totwrit.si=0
  4563.       data.23=data.23 totwrit.si
  4564.     END
  4565.   END
  4566. IF writeopen(bbspath'USERS/'name)=0 THEN RETURN
  4567. IF data.0<27 THEN data.0=27
  4568. DO i=1 TO data.0
  4569.   CALL WRITELN(f,data.i)
  4570. END
  4571. CALL CLOSE(f)
  4572. SAY 'User' name 'has been updated.'
  4573. RETURN
  4574.  
  4575.  
  4576. loadData:
  4577. IF name='' THEN RETURN 0
  4578. IF ~readopen(bbspath'USERS/'name) THEN RETURN 0
  4579. data.=''
  4580. DO i=1
  4581.   line=READLN(f)
  4582.   IF EOF(f) THEN BREAK
  4583.   data.i=line
  4584. END
  4585. data.0=i-1
  4586. CALL CLOSE(f)
  4587. winnings=WORD(data.18,1)
  4588. IF ~DATATYPE(winnings,'N') THEN winnings=0
  4589.  
  4590. setData:
  4591. IF WORDS(data.16)<3 THEN data.16='0 19900101 00:00:00'
  4592. lastbrowse=WORD(data.16,1)
  4593. IF ~DATATYPE(lastbrowse,'W') THEN lastbrowse=0
  4594. level=data.20
  4595. DO i=1 TO level
  4596.   lastread.i=WORD(data.22,i)
  4597.   IF ~DATATYPE(lastread.i,'W') THEN lastread.i=0
  4598.   totwrit.i=WORD(data.23,i)
  4599.   IF ~DATATYPE(totwrit.i,'W') THEN totwrit.i=0
  4600. END
  4601. password=data.5
  4602. IF ~DATATYPE(data.7,'W') THEN data.7=20
  4603. IF data.7<5 THEN data.7=5
  4604. IF FIND(UPPER(data.8),'TERSE')>0 THEN terseflag=1
  4605. ELSE terseflag=0
  4606. IF FIND(UPPER(data.8),'COLOR')>0 THEN colorflag=1
  4607. ELSE colorflag=0
  4608. CALL colors(colorflag)
  4609. IF FIND(UPPER(data.8),'CLEAR')>0 THEN clr='0C'x
  4610. ELSE clr=''
  4611. menu='ALL'
  4612. IF FIND(UPPER(data.8),'MENUS')>0 THEN
  4613.   DO
  4614.     menuflag=1
  4615.     menu='MAIN'
  4616.   END
  4617. ELSE IF FIND(UPPER(data.8),'MENU')>0 THEN menuflag=1
  4618. ELSE menuflag=0
  4619. IF level=0 THEN menu='NEW'
  4620. IF DATATYPE(WORD(data.11,3),'W') THEN
  4621.   DO
  4622.     PARSE VAR data.11 amins . atimes .
  4623.     CALL do_eleven(amins bbsprefs.16 atimes)
  4624.   END
  4625. data.21=UPPER(data.21)
  4626. maxtime=WORD(data.11,1)*60
  4627.  
  4628. loadFriends:
  4629. CALL MAKEDIR(bbspath'Friends')
  4630. alias.=''
  4631. alias.0=0
  4632. realname.=''
  4633. CALL CLOSE(f)
  4634. IF OPEN(f,bbspath'Friends/'name,'R')=0 THEN RETURN 1
  4635. DO i=1
  4636.   line=READLN(f)
  4637.   IF EOF(f) THEN LEAVE i
  4638.   alias.i=WORD(line,1)
  4639.   realname.i=WORD(line,2)
  4640. END
  4641. alias.0=i-1
  4642. CALL CLOSE(f)
  4643. RETURN 1
  4644.  
  4645.  
  4646. switchmenuflag:
  4647. IF menuflag=1 THEN
  4648.   DO
  4649.     menuflag=0
  4650.     noff='OFF'
  4651.   END
  4652. ELSE
  4653.   DO
  4654.     menuflag=1
  4655.     noff='ON'
  4656.   END
  4657. SAY 'Menus turned' pen3||noff||def'.'
  4658. SAY 'To make a permanent change, add or delete MENU(S) from [Y]our userdata item 8.'
  4659. RETURN
  4660.  
  4661.  
  4662. switchcolors:
  4663. IF colorflag=1 THEN
  4664.   DO
  4665.     colorflag=0
  4666.     noff='OFF'
  4667.   END
  4668. ELSE
  4669.   DO
  4670.     colorflag=1
  4671.     noff='ON'
  4672.   END
  4673. CALL colors(colorflag)
  4674. SAY 'Color turned' pen3||noff||def'.'
  4675. SAY 'To make a permanent change, add or delete COLOR from [Y]our userdata item 8.'
  4676. RETURN
  4677.  
  4678.  
  4679. /* ANSI pen color codes */
  4680. colors:
  4681. ARG onoff
  4682. IF onoff THEN
  4683.   DO
  4684.     lineup='1B'x'M'
  4685.     def='';  /* default */
  4686.     pen0='';  pen1='';  pen2='';  pen3=''
  4687.     pen4='';  pen5='';  pen6='';  pen7=''
  4688.     bak0='';  bak1='';  bak2='';  bak3=''
  4689.     bak4='';  bak5='';  bak6='';  bak7=''
  4690.   END
  4691. ELSE
  4692.   DO
  4693.     pen0=''; pen1=''; pen2=''; pen3=''; pen4=''; pen5=''; pen6=''; pen7=''
  4694.     bak0=''; bak1=''; bak2=''; bak3=''; bak4=''; bak5=''; bak6=''; bak7=''
  4695.     def='';  lineup=''
  4696.   END
  4697. RETURN
  4698.  
  4699.  
  4700. sortinfofiles:
  4701. infolist=SHOWDIR(bbspath'Information')
  4702. IF infolist='' THEN
  4703.   DO
  4704.     SAY 
  4705.     SAY pen3'No files are currently in the Information drawer.'def
  4706.     SAY 
  4707.     RETURN 1
  4708.   END
  4709. IF ~DATATYPE(sortinfo.0,'W') THEN
  4710.   DO
  4711.     info.=''
  4712.     sortinfo.=''
  4713.     info.0=WORDS(infolist)
  4714.     DO i=1 TO info.0
  4715.       info.i=WORD(infolist,i)
  4716.     END
  4717.     SAY 'Sorting..'
  4718.     IF info.0>0 THEN CALL QSORT(1,info.0,info)
  4719.     sortinfo.0=info.0%3
  4720.     IF (info.0//3)>0 THEN sortinfo.0=sortinfo.0+1
  4721.     DO i=1 TO sortinfo.0
  4722.       sortinfo.i=''
  4723.       DO j=0 TO 2
  4724.         k=i+j*sortinfo.0
  4725.         IF k<=info.0 THEN
  4726.           DO
  4727.             sortinfo.i=sortinfo.i RIGHT(k,3)'.' LEFT(info.k,19)
  4728.             infocount=WORD(STATEF(bbspath'Information/'info.k),8)
  4729.             sortinfo.i.0=sortinfo.i.0||RIGHT(infocount,5) LEFT(info.k,19)
  4730.           END
  4731.       END
  4732.     END
  4733.     SAY lineup'         'lineup
  4734.   END
  4735. RETURN 0
  4736.  
  4737.  
  4738. information:
  4739. IF sortinfofiles() THEN RETURN
  4740. SAY pen3'These text files are available for reading online...'def
  4741. num=1
  4742. readcount=-1
  4743. DO infoloop=1
  4744.   IF num=0 THEN
  4745.     DO
  4746.       IF readcount~=-1 THEN
  4747.         DO
  4748.           sortinfo.0=''
  4749.           IF sortinfofiles() THEN RETURN
  4750.         END
  4751.       SAY CENTER('- Number of accesses per file -',75)
  4752.     END
  4753.   SAY pen3||LEFT('-',75,'-')||def
  4754.   DO i=1 TO sortinfo.0
  4755.     IF num=0 THEN SAY sortinfo.i.0
  4756.     ELSE SAY sortinfo.i
  4757.   END
  4758.   IF num=0 THEN
  4759.     DO
  4760.       CALL waiting()
  4761.       num=1
  4762.       ITERATE infoloop
  4763.     END
  4764.   num=getinput(1 0 pen3'Select Number Of Information File To View. 0=Stats > 'def)
  4765.   IF num=0 THEN ITERATE infoloop
  4766.   IF ~DATATYPE(num,'W') | num<1 | num>info.0 THEN RETURN
  4767.   readcount=STATEF(bbspath'Information/'info.num)
  4768.   readbytes=WORD(readcount,2)
  4769.   readcount=WORD(readcount,8)
  4770.   IF ~DATATYPE(readcount,'W') THEN readcount=0
  4771.   SAY '  'info.num 'is' readbytes 'bytes.'
  4772.   SAY 'Loading File...'
  4773.   ADDRESS COMMAND 'C:filenote' bbspath'Information/'info.num readcount+1
  4774.   CALL readlines(bbspath'Information/'info.num 1)
  4775.   CALL cleanline(0)
  4776.   SAY '    'lynes.0 'lines.'
  4777.   CALL seelines(0)
  4778.   IF waitchar~='Q' THEN CALL waiting()
  4779.   nonstop=0
  4780. END
  4781. RETURN
  4782.  
  4783.  
  4784. newfiles:
  4785. SAY 
  4786. test=''
  4787. test=getinput(1 1 'Show one library only? (Ny) > ')
  4788. IF test='Y' THEN
  4789.   IF chdir()>0 THEN RETURN
  4790. SAY 'Searching for new (un-browsed) files since' DATE(,WORD(data.16,2),'S') 'at' WORD(data.16,3)'...'
  4791. lastbrowz=WORD(data.16,1)
  4792. lastfileup=countcheck(bbspath'Numbers/LastFile' 0)
  4793.  
  4794. newfiles2:
  4795. IF lastbrowz>=lastfileup THEN
  4796.   DO
  4797.     lastbrowz=0
  4798.     SAY pen3'No new files. Listing backwards by date from last file uploaded...'def
  4799.   END
  4800. ELSE newfilesflag=1
  4801. j=0
  4802. IF test='Y' THEN
  4803.   DO
  4804.     filecount=WORDS(SHOWDIR(bbspath'FileNotes/'plaindir))
  4805.     CALL busywait(4 1)
  4806.   END
  4807. DO ni=lastfileup TO lastbrowz+1 BY -1
  4808.   IF files.ni~='' THEN
  4809.     DO
  4810.       IF test='Y' THEN 
  4811.         DO
  4812.           IF ni>1 THEN CALL busywait(60 ni lastfileup-lastbrowz)
  4813.           IF j>=filecount THEN LEAVE ni
  4814.           IF UPPER(LEFT(WORD(files.ni,1),12))~=UPPER(LEFT(plaindir,12)) THEN
  4815.             ITERATE ni
  4816.         END
  4817.       jj=files.ni.0
  4818.       IF WORD(alpha.jj,4)>level | FIND(data.21,UPPER(WORD(files.ni,1)))>0 THEN
  4819.         ITERATE ni  /* unauthorized */
  4820.       IF test='Y' THEN CALL busywait(4 0)
  4821.       j=j+1
  4822.       IF j=1 THEN CALL fileheader()
  4823.       SAY LEFT(alpha.jj,76)
  4824.       IF (j+2)//(linesperpage-1)=0 THEN
  4825.         IF waiting2() THEN LEAVE ni
  4826.       IF test='Y' THEN CALL busywait(4 1)
  4827.     END
  4828. END
  4829. IF test='Y' THEN CALL busywait(4 0)
  4830. IF j//linesperpage~=0 THEN CALL waiting()
  4831. IF j=0 & newfilesflag=1 THEN
  4832.   DO
  4833.     lastbrowz=999999
  4834.     newfilesflag=0
  4835.     CALL newfiles2()
  4836.   END
  4837. IF test~='Y' THEN
  4838.   DO
  4839.     CALL newinfo()
  4840.     IF lynes.0>0 THEN CALL waiting()
  4841.   END
  4842. nonstop=0
  4843. RETURN
  4844.  
  4845.  
  4846. newinfo:
  4847. lynes.=''
  4848. lynes.0=0
  4849. dm=DATE(,WORD(data.16,2),'S')
  4850. PARSE VAR dm da' 'mo' 'yr .
  4851. yr=RIGHT(yr,2)
  4852. sincedate=da'-'mo'-'yr
  4853. startline=1
  4854. arg=bbspath'Information'
  4855. IF WORD(STATEF(arg),5)>lastondate THEN
  4856.   DO
  4857.     ADDRESS COMMAND 'C:LIST >ram:locdirlist' arg 'NOHEAD DATES SINCE' sincedate
  4858.     IF WORD(STATEF('ram:locdirlist'),2)>3 THEN
  4859.       DO
  4860.         lynes.startline=pen1||bak2' New or Updated Information Files. Enter'def pen3'I'def bak2'from the main menu to read 'def
  4861.         CALL readlines('ram:locdirlist' startline+1)
  4862.       END
  4863.   END
  4864. arg=bbspath'Profiles'
  4865. IF level>0 & WORD(STATEF(arg),5)>lastondate THEN
  4866.   DO
  4867.     ADDRESS COMMAND 'C:LIST >ram:locdirlist' arg 'NOHEAD DATES SINCE' sincedate
  4868.     IF WORD(STATEF('ram:locdirlist'),2)>3 THEN
  4869.       DO
  4870.         startline=lynes.0+2
  4871.         lynes.startline=pen1||bak2' New or Updated User Profiles. Enter'def pen3'&'def bak2'from the main menu to read 'def
  4872.         CALL readlines('ram:locdirlist' startline+1)
  4873.       END
  4874.   END
  4875. arg=bbspath'rexxDoors/Data/Polls'
  4876. IF level>0 & WORD(STATEF(arg),5)>lastondate THEN
  4877.   DO
  4878.     startline=lynes.0+2
  4879.     lynes.startline=pen1||bak2' Voting Activity. Enter'def pen3'J'def bak2'from the main menu, then select Polling_Place 'def
  4880.     lynes.0=startline
  4881.   END
  4882. IF logonflag=1 THEN nonstop=1
  4883. IF lynes.0>0 THEN CALL seelines(1)
  4884. nonstop=0
  4885. RETURN
  4886.  
  4887.  
  4888. areaselect:
  4889. SAY pen3||LEFT('-',75,'-')||def
  4890. DO i=1 TO msgs.0
  4891.   SAY msgs.i
  4892.   IF i//linesperpage=0 THEN CALL waiting()
  4893. END
  4894. temp=getinput(1 0 pen3'Select Message Conference: 'def)
  4895. IF ~DATATYPE(temp,'W') | temp<1 | temp>level | FIND(data.21,temp)>0 THEN RETURN 1
  4896. IF msg.temp='' THEN RETURN 1
  4897. msgdir=temp
  4898. RETURN 0
  4899.  
  4900.  
  4901. chdir:
  4902. string=''
  4903. SAY pen3||LEFT('-',75,'-')||def
  4904. DO i=1 TO libs.0
  4905.   SAY libs.i
  4906. END
  4907. dirnum=getinput(1 0 pen3'Select Library Number: 'def)
  4908. IF clr~='' THEN SAY clr
  4909. IF ~DATATYPE(dirnum,'W') THEN
  4910.   DO
  4911.     waitchar=dirnum
  4912.     RETURN 2
  4913.   END
  4914.  
  4915. chdir2:
  4916. IF dirnum<1 | dirnum>99 THEN
  4917.   DO
  4918.     waitchar=dirnum
  4919.     RETURN 1
  4920.   END
  4921. IF dirs.dirnum='' THEN
  4922.   DO
  4923.     SAY pen3'That library number is currently un-assigned.'def
  4924.     RETURN 1
  4925.   END
  4926. IF dirnum>level | FIND(data.21,UPPER(dirs.dirnum))>0 THEN
  4927.   DO
  4928.     SAY pen3'You do not have authorization for that library!'def
  4929.     RETURN 1
  4930.   END
  4931. CALL MAKEDIR(libpath||dirs.dirnum)
  4932. CALL setdir(libpath||dirs.dirnum)
  4933. t=libpath||plaindir'.txt'
  4934. IF ~EXISTS(t) THEN RETURN 0
  4935. nonstop=1
  4936. SAY
  4937. CALL readlines(t 1)
  4938. CALL seelines(1)
  4939. SAY
  4940. nonstop=0
  4941. RETURN 0
  4942.  
  4943.  
  4944. since:
  4945. dm=DATE(,WORD(data.16,2),'S')
  4946. SAY 
  4947. SAY 'New files or files moved since' dm
  4948. CALL listsince()
  4949. CALL readlines('ram:locdirlist' 1)
  4950. CALL seelines(1)
  4951. nonstop=0
  4952. CALL waiting()
  4953. RETURN
  4954.  
  4955.  
  4956. listsince:
  4957. dm=DATE(,WORD(data.16,2),'S')
  4958. PARSE VAR dm da' 'mo' 'yr .
  4959. yr=RIGHT(yr,2)
  4960. sincedate=da'-'mo'-'yr
  4961. ADDRESS COMMAND 'C:list >ram:locdirlist' directory 'DATES SINCE' sincedate
  4962. RETURN
  4963.  
  4964.  
  4965. list:
  4966. onetime=0
  4967. IF DATATYPE(arg,'W') THEN onetime=1
  4968. ELSE arg=''
  4969. DO listloop=1
  4970.   IF DATATYPE(arg,'W') THEN
  4971.     DO
  4972.       dirnum=arg
  4973.       arg=''
  4974.       IF chdir2()>0 THEN RETURN
  4975.       CALL listsimple()
  4976.       IF waitchar='Q' | onetime THEN LEAVE listloop
  4977.     END
  4978.   ELSE IF arg='' THEN
  4979.     DO
  4980.       IF chdir()>0 THEN RETURN
  4981.       test='Y'
  4982.       CALL showalpha2()
  4983.       arg=''
  4984.       IF waitchar='Q' THEN waitchar=''
  4985.       IF waitchar~='' THEN RETURN
  4986.       ITERATE listloop
  4987.     END
  4988.   ELSE RETURN
  4989. END
  4990. RETURN
  4991.  
  4992.  
  4993. listsimple:
  4994. ADDRESS COMMAND 'C:list >ram:locdirlist' directory 'DATES'
  4995. IF readlines('ram:locdirlist' 1) THEN RETURN
  4996. IF lynes.0>3 THEN
  4997.   DO
  4998.     SAY pen3'Sorting...'def||lineup
  4999.     linesave=lynes.1  /* these 4 lines put in to leave dir title at top */
  5000.     lynes.1='0'
  5001.     IF lynes.0>1 THEN CALL QSORT(1,lynes.0-1,lynes)
  5002.     CALL DELAY(14)
  5003.     lynes.1=linesave
  5004.   END
  5005. CALL seelines(1)
  5006. nonstop=0
  5007. CALL waiting()
  5008. RETURN
  5009.  
  5010.  
  5011. browse:
  5012. curdironly=0
  5013. brdir=PRAGMA('D')
  5014. brfilenum=1
  5015. nonstop=0
  5016. IF files.0<1 THEN RETURN
  5017. lastfilenum=countcheck(bbspath'Numbers/LastFile' 0)
  5018. IF lastfilenum<1 THEN RETURN
  5019. onearg=0
  5020. IF arg='' THEN
  5021.   DO
  5022.     lin='Browsing'
  5023.     test=getinput(1 1 'Browse one library only? (Ny) > ')
  5024.     IF test='Y' THEN
  5025.       DO
  5026.         IF chdir()>0 THEN RETURN
  5027.         curdironly=1
  5028.         lin=lin 'the' pen3||plaindir||def 'library'
  5029.         t=libpath||plaindir'.txt'
  5030.         IF level>sysoplevel THEN
  5031.           IF getinput(1 1 'Edit the'pen3 Plaindir def'library info file? (Ny) > ')='Y' THEN
  5032.             DO
  5033.               IF ~EXISTS(t) THEN
  5034.                 DO
  5035.                   IF writeopen(t)~=0 THEN
  5036.                     DO
  5037.                       CALL WRITELN(f,TRIM(CENTER('***' plaindir '***',77)))
  5038.                       CALL WRITELN(f,LEFT('',75,'='))
  5039.                       CALL CLOSE(f)
  5040.                       CALL DELAY(28)
  5041.                     END
  5042.                 END
  5043.               CALL bbsED(1 t)
  5044.               RETURN
  5045.             END
  5046.       END
  5047.     ELSE lin=lin 'all file libraries'
  5048.     lin=lin 'backwards from latest file.'
  5049.     SAY lin
  5050.     SAY
  5051.   END
  5052. ELSE onearg=1
  5053. i=0
  5054. IF arg='' | UPPER(arg)='NEW' | UPPER(arg)='ALL' THEN
  5055.   DO lastfileloop=1
  5056.     IF lastfilenum<1 THEN RETURN
  5057.     arg=WORD(files.lastfilenum,2)
  5058.     brfilenum=lastfilenum
  5059.     IF WORD(files.lastfilenum,2)~='' THEN LEAVE lastfileloop
  5060.     lastfilenum=lastfilenum-1
  5061.   END
  5062. ELSE IF DATATYPE(arg,'W') THEN
  5063.   DO
  5064.     brfilenum=arg
  5065.     arg=WORD(files.arg,2)
  5066.     IF arg='' THEN
  5067.       DO
  5068.         SAY 'File number' brfilenum 'does not exist in the current libraries!'
  5069.         RETURN
  5070.       END
  5071.   END
  5072. ELSE
  5073.   DO
  5074.     IF onearg THEN CALL busywait(4 1)
  5075.     DO ni=lastfilenum TO 1 BY -1
  5076.       IF onearg THEN CALL busywait(60 ni lastfilenum)
  5077.       IF UPPER(WORD(files.ni,2))~=UPPER(arg) THEN ITERATE ni
  5078.       brfilenum=ni
  5079.       CALL busywait(4 0)
  5080.       LEAVE ni
  5081.     END
  5082.     IF ni<1 THEN
  5083.       DO
  5084.         SAY 'Unable to find a file description for' pen3||arg||def'.'
  5085.         RETURN
  5086.       END
  5087.   END
  5088. IF ~curdironly THEN CALL setdir(libpath||WORD(files.brfilenum,1))
  5089. savearg=arg
  5090. IF brfilenum>lastfilenum THEN brfilenum=lastfilenum
  5091. newfilesdate=DATE('S') TIME()
  5092. DO browseloop=1
  5093.   IF curdironly THEN CALL busywait(4 1)
  5094.   DO ni=brfilenum TO 0 BY -1
  5095.     IF ni=0 THEN LEAVE browseloop
  5096.     IF files.ni='' THEN ITERATE ni
  5097.     IF onearg THEN
  5098.       DO
  5099.         CALL busywait(60 ni lastfilenum)
  5100.         IF UPPER(arg)~=UPPER(WORD(files.ni,2)) THEN ITERATE ni
  5101.         IF (ni//30)>0 THEN CALL busywait(4 1)
  5102.         LEAVE ni
  5103.       END
  5104.     testdir=UPPER(WORD(files.ni,1))
  5105.     IF curdironly & UPPER(plaindir)~=UPPER(testdir) THEN
  5106.       DO
  5107.         IF ni>lastbrowse THEN lastbrowse=ni
  5108.         IF ni>0 THEN CALL busywait(60 ni lastfilenum)
  5109.         ITERATE ni
  5110.       END
  5111.     IF FIND(data.21,testdir)>0 | finddirnum(testdir)>level THEN
  5112.       DO
  5113.         IF ni>lastbrowse THEN lastbrowse=ni
  5114.         ITERATE ni
  5115.       END
  5116.     LEAVE ni
  5117.   END
  5118.   IF curdironly | onearg THEN CALL busywait(4 0)
  5119.   onearg=0
  5120.   IF ni=0 THEN brfilenum=lastbrowse
  5121.   ELSE brfilenum=ni
  5122.   argname=WORD(files.brfilenum,2)
  5123.   IF argname='' THEN RETURN
  5124.   CALL setdir(libpath||WORD(files.brfilenum,1))
  5125.   arg=bbspath'FileNotes/'plaindir'/'argname
  5126.   CALL readlines(arg 1)
  5127.   IF nonstop=1 THEN brostop=1
  5128.   ELSE brostop=0
  5129.   CALL seelines(1)
  5130.   IF brfilenum>lastbrowse THEN lastbrowse=brfilenum
  5131.   IF brostop THEN
  5132.     DO
  5133.       SAY
  5134.       nonstop=1
  5135.       brfilenum=brfilenum-1
  5136.     END
  5137.   ELSE
  5138.     DO
  5139.       line=''
  5140.       endtest=UPPER(RIGHT(argname,4))
  5141.       IF FIND('.ARC .ARJ .DMS .LZH .LHA .RUN .ZIP .ZOO',endtest)>0 THEN
  5142.         line='['pen3'C'def']ontents ['pen3'D'def']ownload'
  5143.       ELSE line='['pen3'D'def']ownload'
  5144.       IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  5145.         line=line '['pen3'E'def']dit'
  5146.       IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  5147.         line=line '['pen3'K'def']ill'
  5148.       IF level>sysoplevel THEN line=line '['pen3'L'def']ib'
  5149.       line=line '['pen3'M'def']ark ['pen3'N'def']on-Stop'
  5150.       IF endtest='.TXT' THEN line=line '['pen3'R'def']ead'
  5151.       line=line '['pen3'Q'def']uit ['pen3'?'def'] > '
  5152.       brcom=getinput(1 0 line)
  5153.       IF DATATYPE(brcom,'W') THEN
  5154.         DO
  5155.           brfilenum=brcom+1
  5156.           IF brfilenum>lastfilenum THEN brfilenum=lastfilenum+1
  5157.           IF brfilenum<1 THEN brfilenum=1
  5158.           SAY
  5159.         END
  5160.       ELSE brcom=LEFT(brcom,1)
  5161.       CALL cleanline(0)
  5162.       IF brcom='Q' THEN LEAVE browseloop
  5163.       IF brcom='M' THEN
  5164.         DO
  5165.           wordnum=FIND(data.25,brfilenum)
  5166.           IF wordnum=0 THEN
  5167.             DO
  5168.               data.25=STRIP(data.25 brfilenum)
  5169.               SAY lineup||argname 'marked for next download.'
  5170.               SAY
  5171.             END
  5172.           ELSE
  5173.             DO
  5174.               data.25=STRIP(DELWORD(data.25,wordnum,1))
  5175.               SAY argname 'removed from download list.'
  5176.             END
  5177.         END
  5178.       IF brcom='H' | brcom='?' THEN
  5179.         DO
  5180.           SAY pen3' - HELP with the Browse Files commands -'def
  5181.           SAY ' RETURN reads the next file description in line.'
  5182.           SAY ' 34 will display the description of file number 34, if it exists.'
  5183.           SAY ' C  displays the contents of an archived (arc dms lzh lha zip zoo) file.'
  5184.           SAY ' D  displays the download menu.'
  5185.           IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  5186.             DO
  5187.           SAY ' E  puts this file description into the online Editor.'
  5188.           SAY ' K  deletes a file you uploaded. you cannot Kill others!'
  5189.             END
  5190.           IF level>sysoplevel THEN
  5191.           SAY ' L  move file and description to new Library and/or rename.'
  5192.           SAY ' M  mark/unmark the current file for the next download'
  5193.           SAY ' N  displays all descriptions without pausing. CTRL-E to Exit!'
  5194.           SAY ' R  displays file as text. - ONLY FILES THAT END IN .TXT -'
  5195.           SAY ' Q  returns to the main menu(s). (Quit)'
  5196.           SAY
  5197.           CALL waiting()
  5198.           IF waitchar='Q' THEN LEAVE browseloop
  5199.         END
  5200.       ELSE IF brcom='L' & level>sysoplevel THEN
  5201.         DO
  5202.           curdir=PRAGMA('D')
  5203.           IF getinput(1 1 'Rename' argname '? (Ny) > ')='Y' THEN
  5204.             DO
  5205.               newarg=getinput(0 0 'Rename' argname 'to ')
  5206.               IF newarg~='' THEN
  5207.                 DO
  5208.                   IF is_here(newarg) THEN ITERATE browseloop
  5209.                   IF wi=999999 THEN ITERATE browseloop
  5210.                   IF EXISTS(libpath||filedir'/'newarg) THEN
  5211.                     DO
  5212.                       SAY
  5213.                       SAY '***' newarg 'already exists!'
  5214.                       SAY
  5215.                       ITERATE browseloop
  5216.                     END
  5217.                   junk=getinput(1 1 'Are you SURE you want to rename' argname 'to' newarg'? (Ny) ')
  5218.                   IF junk='Y' THEN
  5219.                     DO
  5220.                       lynes.2=OVERLAY(newarg,lynes.2,7,25)
  5221.                       comment=WORD(STATEF(arg),8)
  5222.                       CALL DELETE(arg)
  5223.                       arg=bbspath'FileNotes/'plaindir'/'newarg
  5224.                       CALL savelines(arg)
  5225.                       IF comment='' THEN
  5226.                         DO
  5227.                           mpath=libpath||plaindir
  5228.                           IF RENAME(mpath'/'argname,mpath'/'newarg)=0 THEN
  5229.                             SAY 'Rename failed on main file!'
  5230.                         END
  5231.                       ELSE
  5232.                         DO
  5233.                           t=LASTPOS('/',comment)
  5234.                           IF t=0 THEN t=LASTPOS(':',comment)
  5235.                           mpath=LEFT(comment,t-1)
  5236.                           IF RENAME(comment,mpath'/'newarg)=1 THEN
  5237.                             ADDRESS COMMAND 'C:FileNote' arg mpath'/'newarg
  5238.                           ELSE SAY 'Rename failed on external file!'
  5239.                         END
  5240.                       files.brfilenum=STRIP(WORD(files.brfilenum,1)) newarg
  5241.                       anum=files.brfilenum.0
  5242.                       alpha.anum=OVERLAY(newarg,alpha.anum,1,WORDINDEX(alpha.anum,2)-2)
  5243.                       argname=newarg
  5244.                       sortalphaflag=1
  5245.                       savefileflag=1
  5246.                     END
  5247.                 END
  5248.             END
  5249.           mvdir=getinput(0 0 'Move' argname 'to Library (name|number) ')
  5250.           IF mvdir~='' THEN
  5251.             DO
  5252.               IF DATATYPE(mvdir,'W') THEN
  5253.                 DO
  5254.                   dirnum=mvdir
  5255.                   IF UPPER(dirs.dirnum)~=UPPER(WORD(files.brfilenum,1)) THEN
  5256.                     DO
  5257.                       IF chdir2()=0 THEN
  5258.                         DO
  5259.                           CALL readlines(arg 1)
  5260.                           CALL movefile(brfilenum dirs.dirnum)
  5261.                         END
  5262.                     END
  5263.                 END
  5264.               ELSE
  5265.                 DO
  5266.                   mvdir=STRIP(mvdir)
  5267.                   IF UPPER(mvdir)~=UPPER(WORD(files.brfilenum,1)) THEN
  5268.                     DO
  5269.                       DO mj=1 TO level+1
  5270.                         IF UPPER(mvdir)=UPPER(dirs.mj) THEN LEAVE mj
  5271.                       END
  5272.                       IF mj<=level THEN CALL movefile(brfilenum mvdir)
  5273.                     END
  5274.                 END
  5275.             END
  5276.           IF savefileflag>0 THEN CALL savefilelist()
  5277.           CALL setdir(curdir)
  5278.         END
  5279.       ELSE IF brcom='N' THEN
  5280.         DO
  5281.           brfilenum=brfilenum-1
  5282.           nonstop=1
  5283.           SAY pen3'To EXIT non-stop scrolling of text, press CTRL-E'def
  5284.           SAY
  5285.           CALL DELAY(100)
  5286.           brcom=''
  5287.         END
  5288.       ELSE IF brcom='C' THEN
  5289.         DO
  5290.           temp=STRIP(WORD(STATEF(arg),8))
  5291.           IF temp='' THEN temp=libpath||plaindir'/'argname
  5292.           CALL Contents.rexx(temp)
  5293.           IF EXISTS('RAM:CONTENTS') THEN
  5294.             DO
  5295.               CALL readlines('RAM:CONTENTS' 1)
  5296.               CALL seelines(0)
  5297.               IF waitchar~='Q' THEN CALL waiting()
  5298.               nonstop=0
  5299.             END
  5300.           ELSE SAY pen3'Not an archived file.'def
  5301.         END
  5302.       ELSE IF brcom='D' THEN
  5303.         DO
  5304.           arg2=arg
  5305.           arg=brfilenum
  5306.           CALL dload()
  5307.           arg=arg2
  5308.         END
  5309.       ELSE IF brcom='E' THEN
  5310.         DO
  5311.           IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  5312.             DO
  5313.               firstedit=5
  5314.               IF level>sysoplevel THEN firstedit=1
  5315.               CALL bbsED(firstedit arg)
  5316.             END
  5317.         END
  5318.       ELSE IF brcom='K' THEN
  5319.         DO
  5320.           IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  5321.             DO
  5322.               IF getinput(1 1 pen3'Do you really want to kill this file? (nY) >'def)~='N' THEN
  5323.                 DO
  5324.                   tempnum=WORD(lynes.1,2)
  5325.                   IF tempnum=lastfilenum THEN
  5326.                     DO
  5327.                       CALL DELETE(bbspath'Numbers/LastFile')
  5328.                       CALL DELAY(28)
  5329.                       lastfilenum=lastfilenum-1
  5330.                       CALL countcheck(bbspath'Numbers/LastFile' lastfilenum)
  5331.                     END
  5332.                   files.tempnum=''
  5333.                   tempnum2=files.tempnum.0
  5334.                   alpha.tempnum2='0 0' tempnum '100'
  5335.                   CALL savefilelist()
  5336.                   finfo=STATEF(arg)
  5337.                   IF WORDS(finfo)>7 THEN argname=WORD(finfo,8)
  5338.                   CALL DELETE(argname)
  5339.                   CALL DELETE(arg)
  5340.                   SAY argname pen3'has been deleted.'def
  5341.                 END
  5342.             END
  5343.         END
  5344.       ELSE IF brcom='R' & endtest='.TXT' THEN
  5345.         DO
  5346.           vcount=WORD(lynes.2,7)+1
  5347.           lynes.2=STRIP(DELWORD(lynes.2,7,1)) vcount
  5348.           edtype=''
  5349.           CALL savelines(arg)
  5350.           CALL showtext(argname)
  5351.         END
  5352.       ELSE brfilenum=brfilenum-1
  5353.     END
  5354. END
  5355. CALL setdir(brdir)
  5356. waitchar=''
  5357. IF nonstop THEN CALL waiting()
  5358. nonstop=0
  5359. CALL savedata(0)
  5360. RETURN
  5361.  
  5362.  
  5363. movefile:
  5364. PARSE ARG fnum movdir .
  5365. fromdir=STRIP(WORD(files.fnum,1))
  5366. farg=STRIP(WORD(files.fnum,2))
  5367. md=libpath||movdir
  5368. mf=md'/'farg
  5369. fd=libpath||fromdir
  5370. ff=fd'/'farg
  5371. fn=bbspath'FileNotes/'fromdir'/'farg
  5372. commen=WORD(STATEF(fn),8)
  5373. IF commen~='' THEN
  5374.   DO
  5375.     ff=commen
  5376.     n=LASTPOS('/',ff)
  5377.     IF n>1 THEN
  5378.       DO
  5379.         xf=SUBSTR(ff,n+1)
  5380.         tfd=LEFT(ff,n-1)
  5381.         n=LASTPOS('/',tfd)
  5382.         IF n=0 THEN n=LASTPOS(':',tfd)
  5383.         IF n>0 THEN
  5384.           DO
  5385.             tmd=LEFT(tfd,n)||movdir
  5386.             SAY 'Rename external file'pen3 ff||def
  5387.             IF getinput(1 1 '                  to'pen3 tmd'/'farg||def'? (Ny) > ')='Y' THEN
  5388.               DO
  5389.                 fd=tfd
  5390.                 md=tmd
  5391.                 mf=md'/'farg
  5392.                 commen=md'/'xf
  5393.               END
  5394.             ELSE IF getinput(1 1 '          or move to'pen3 mf||def'? (Ny) > ')='Y' THEN
  5395.               DO
  5396.                 fd=tfd
  5397.                 commen=''
  5398.               END
  5399.           END
  5400.       END
  5401.   END
  5402. CALL MAKEDIR(md)
  5403. IF RENAME(ff,mf)=0 THEN
  5404.   DO
  5405.     ADDRESS COMMAND 'C:COPY' ff mf
  5406.     IF EXISTS(mf) THEN
  5407.       IF DELETE(ff)~=1 THEN SAY pen3'Unable to delete'def ff||pen3'.'def
  5408.   END
  5409. files.fnum=movdir farg
  5410. lynes.3=DELWORD(lynes.3,WORDS(lynes.3),1)
  5411. lynes.3=STRIP(lynes.3) movdir
  5412. CALL MAKEDIR(bbspath'FileNotes/'movdir)
  5413. mn=bbspath'FileNotes/'movdir'/'farg
  5414. CALL savelines(mn)
  5415. ndx=files.fnum.0
  5416. dnum=finddirnum(movdir)
  5417. alpha.ndx=OVERLAY(RIGHT(dnum,2) movdir,alpha.ndx,31,15)
  5418. IF EXISTS(mn) THEN
  5419.   DO
  5420.     CALL DELETE(fn)
  5421.     IF commen~='' THEN ADDRESS COMMAND 'C:FileNote' mn commen
  5422.   END
  5423. savefileflag=1
  5424. line='Moved:' fromdir'/'farg 'to' movdir
  5425. SAY line
  5426. RETURN
  5427.  
  5428.  
  5429. textsearch:
  5430. PARSE ARG sfile' 'sarg
  5431. IF sarg='' THEN RETURN 0
  5432. x=OPEN(f,sfile,'R')
  5433. IF x=0 THEN RETURN 0
  5434. sarg=UPPER(sarg)
  5435. stemp=UPPER(READCH(f,65000))
  5436. CALL CLOSE(f)
  5437. retflag=0
  5438. IF POS(sarg,stemp)>0 THEN retflag=1
  5439. DROP stemp
  5440. RETURN retflag
  5441.  
  5442.  
  5443. bbsSEARCH:
  5444. smenu=menu
  5445. test=UPPER(LEFT(arg,1))
  5446. IF test='F' THEN smenu='FILE'
  5447. IF test='M' THEN smenu='MSG'
  5448. IF test='U' THEN smenu='MAIN'
  5449. IF smenu='ALL' THEN
  5450.   DO
  5451.     junk=getinput(1 1 'Search ['pen3'F'def']iles ['pen3'M'def']essages or ['pen3'U'def']sers (fmu) > ')
  5452.     IF junk='F' THEN smenu='FILE'
  5453.     ELSE IF junk='M' THEN smenu='MSG'
  5454.     ELSE IF junk='U' THEN smenu='MAIN'
  5455.     ELSE RETURN
  5456.   END
  5457. IF WORDS(arg)>1 THEN searcharg=UPPER(SUBSTR(arg,WORDINDEX(arg,2)))
  5458. ELSE searcharg=getinput(0 0 pen3'Search Phrase: 'def)
  5459. IF LENGTH(STRIP(searcharg))=0 THEN RETURN
  5460. searcharg=COMPRESS(searcharg,'*')
  5461. IF smenu='NEW' | smenu='MAIN' THEN
  5462.   DO
  5463.     SAY 'Searching Userlist...'
  5464.     DO i=1 TO WORDS(userlist)
  5465.       IF POS(UPPER(searcharg),UPPER(WORD(userlist,i)))>0 THEN
  5466.         SAY WORD(userlist,i)
  5467.     END
  5468.   END
  5469. IF smenu='MSG' THEN
  5470.   DO
  5471.     IF getinput(1 1 'Search one conference only? (Ny) > ')='Y' THEN
  5472.       DO
  5473.         IF areaselect() THEN RETURN
  5474.         SAY 'Searching' msg.msgdir 'Message Conference for'pen3 searcharg||def'...'
  5475.         SAY
  5476.         CALL searchmsgdir()
  5477.       END
  5478.     ELSE
  5479.       DO
  5480.         SAY 'Searching All Public Message Conferences for'pen3 searcharg||def'...'
  5481.         SAY
  5482.         DO i=1 TO level
  5483.           msgdir=i
  5484.           IF msg.msgdir='' | FIND(data.21,msgdir)>0 THEN ITERATE i
  5485.           CALL searchmsgdir()
  5486.           i=msgdir
  5487.           IF msgcom='Q' THEN i=999999
  5488.         END
  5489.       END
  5490.   END
  5491. IF smenu='FILE' THEN
  5492.   DO
  5493.     line=pen3'Searching'
  5494.     curdironly=0
  5495.     IF getinput(1 1 'Search one library only? (Ny) > ')='Y' THEN
  5496.       DO
  5497.         IF chdir()>0 THEN RETURN
  5498.         curdironly=1
  5499.         line=line 'the'def plaindir pen3'library'
  5500.         SAY
  5501.       END
  5502.     ELSE
  5503.       DO
  5504.         line=line 'all file libraries'
  5505.         SAY
  5506.         SAY pen3'WARNING!'def 'Searching' RIGHT(files.0,5) '['pen3'F'def']ull descriptions may take'pen3 TRUNC(files.0/(114*cpu)+.05,1) def'minutes!'
  5507.       END
  5508.     test=getinput(1 1 '   ['pen3'A'def']lphaList search or ['pen3'F'def']ull descriptions? (Afq) > ')
  5509.     IF test='Q' THEN RETURN
  5510.     SAY
  5511.     SAY line 'for'def UPPER(searcharg)
  5512.     SAY pen3' - To ABORT, press CTRL-E -'def
  5513.     SAY
  5514.     IF test~='F' THEN
  5515.       DO
  5516.         CALL fileheader()
  5517.         DO i=1 TO alpha.0
  5518.           CALL busywait(60 i alpha.0)
  5519.           ii=WORD(alpha.i,4)
  5520.           IF ii>level THEN ITERATE i
  5521.           IF curdironly=1 & ii~=dirnum THEN ITERATE i
  5522.           ii=WORD(alpha.i,3)
  5523.           IF POS(UPPER(WORD(files.ii,1)),data.21)>0 THEN ITERATE i
  5524.           tempnum=POS(UPPER(searcharg),UPPER(alpha.i))
  5525.           IF tempnum>0 THEN
  5526.             DO
  5527.               CALL busywait(4 0)
  5528.               SAY alpha.i
  5529.               IF colorflag=1 THEN
  5530.                 SAY pen3||LEFT(' ',tempnum-1)||lineup||UPPER(searcharg)||def
  5531.               CALL busywait(4 1)
  5532.             END
  5533.         END
  5534.       END
  5535.     ELSE
  5536.       DO
  5537.         cck=countcheck(bbspath'Numbers/LastFile' 0)
  5538.         nonstop=1
  5539.         DO i=1 TO cck
  5540.           iii=cck+1-i
  5541.           IF files.iii='' THEN ITERATE i
  5542.           ii=files.iii.0
  5543.           ii=WORD(alpha.ii,4)
  5544.           IF ii>level THEN ITERATE i
  5545.           IF curdironly=1 & ii~=dirnum THEN ITERATE i
  5546.           IF POS(UPPER(WORD(files.iii,1)),data.21)>0 THEN ITERATE i
  5547.           farg=WORD(files.iii,1)'/'WORD(files.iii,2)
  5548.           SAY '1B'x'M' RIGHT(farg,40) LEFT(iii,7)
  5549.           IF textsearch(bbspath'FileNotes/'farg searcharg) THEN
  5550.             DO
  5551.               savei=i
  5552.               CALL readlines(bbspath'FileNotes/'farg 1)
  5553.               nonstop=1
  5554.               CALL seelines(2)
  5555.               i=savei
  5556.               SAY
  5557.               SAY
  5558.             END
  5559.         END
  5560.       END
  5561.     CALL busywait(4 0)
  5562.   END
  5563. searcharg=''
  5564. nonstop=0
  5565. SAY
  5566. IF i<999999 THEN SAY 'All available items have been searched.'
  5567. SAY
  5568. CALL waiting()
  5569. RETURN
  5570.  
  5571.  
  5572. searchmsgdir:
  5573. msglist=SHOWDIR(msgpath||msgdir)
  5574. IF WORDS(msglist)>0 THEN SAY lineup||RIGHT(msg.msgdir,40)
  5575. qi=WORDS(msglist)
  5576. DO wi=1 TO qi
  5577.   CALL busywait(8 wi qi)
  5578.   messnum=WORD(msglist,wi)%1
  5579.   IF textsearch(msgpath||msgdir'/'messnum searcharg) THEN
  5580.     DO
  5581.       CALL busywait(4 0)
  5582.       savelast=lastread.msgdir
  5583.       CALL readmsg(0 messnum)
  5584.       lastread.msgdir=savelast
  5585.       IF msgcom='Q' THEN RETURN
  5586.       CALL busywait(4 1)
  5587.     END
  5588. END
  5589. CALL busywait(4 0)
  5590. RETURN
  5591.  
  5592.  
  5593. finddirnum:
  5594. ARG fdirname .
  5595. DO fdir=1 TO 99
  5596.   IF UPPER(dirs.fdir)=UPPER(fdirname) THEN RETURN fdir
  5597. END
  5598. RETURN 100
  5599.  
  5600.  
  5601. writebuffer:
  5602. PARSE ARG bufname .
  5603. CALL DELETE(bufname)
  5604. startnum=lynes.0+1
  5605. OPTIONS PROMPT ''
  5606. SAY pen3'LOCAL logon! Input cannot exceed 250 characters per line!'def
  5607. SAY 'Type 'pen3'/E'def 'or' pen3'/S'def' on a new line to exit and' pen3'DO YOUR OWN WORDWRAP!'def
  5608. DO bufloop=startnum
  5609.   PARSE PULL line
  5610.   IF LEFT(UPPER(STRIP(line)),2)='/E' | LEFT(UPPER(STRIP(line)),2)='/S' THEN
  5611.     LEAVE bufloop
  5612.   lynes.bufloop=line
  5613. END
  5614. lynes.0=bufloop-1
  5615. CALL wrapbuf(startnum)
  5616. CALL DELETE(bufname)     /* these 4 lines make wordwrap more consistent */
  5617. CALL savelines(bufname)
  5618. CALL readlines(bufname 1)
  5619. CALL wrapbuf(startnum)
  5620. RETURN
  5621.  
  5622.  
  5623. wrapbuf:
  5624. ARG startnum .
  5625. CALL cleanline(1)
  5626. SAY pen3'Wordwrapping...'def
  5627. lynes.startnum=TRANSLATE(lynes.startnum,' ','09'x)
  5628. lynes.startnum=COMPRESS(lynes.startnum,'0C'x)  /* no FF */
  5629. DO wi=startnum WHILE wi<=lynes.0
  5630.   wj=wi+1
  5631.   lynes.wj=COMPRESS(lynes.wj,'08'x||'0C'x||'7F'x)
  5632.   tabpos=POS('09'x,lynes.wi)
  5633.   DO WHILE tabpos>0
  5634.     lynes.wi=DELSTR(lynes.wi,tabpos,1)
  5635.     lynes.wi=INSERT('  ',lynes.wi,tabpos-1)
  5636.     tabpos=POS('09'x,lynes.wi)
  5637.   END
  5638.   IF LENGTH(lynes.wi)>75 THEN
  5639.     DO
  5640.       testchar=''
  5641.       IF lynes.wj~='' THEN testchar=LEFT(lynes.wj,1)
  5642.       IF testchar=' ' | testchar='.' | testchar=':' THEN
  5643.         DO
  5644.           DO wjj=lynes.0 TO wi+1 BY -1
  5645.             wk=wjj+1
  5646.             lynes.wk=lynes.wjj
  5647.           END
  5648.           lynes.wj=''
  5649.           lynes.0=lynes.0+1
  5650.         END
  5651.       DO wl=WORDS(lynes.wi) TO 1 BY -1 WHILE LENGTH(lynes.wi)>74
  5652.         IF WORDS(lynes.wi)=1 THEN
  5653.           lynes.wi=LEFT(lynes.wi,74) SUBSTR(lynes.wi,75)
  5654.         lynes.wj=WORD(lynes.wi,wl) lynes.wj
  5655.         lynes.wi=STRIP(DELWORD(lynes.wi,wl,1))
  5656.       END
  5657.     END
  5658. END
  5659. RETURN
  5660.  
  5661.  
  5662. seelines:
  5663. ARG fancy .
  5664. DO i=1 TO lynes.0
  5665.   IF fancy=0 THEN SAY lynes.i||def
  5666.   ELSE
  5667.     DO
  5668.       IF LEFT(lynes.i,2)=': ' & WORDS(lynes.i)=2 THEN ITERATE i
  5669.       ELSE IF LEFT(lynes.i,10)='Directory ' | LEFT(lynes.i,5)='=====' THEN
  5670.         SAY pen3||lynes.i||def
  5671.       ELSE SAY lynes.i
  5672.       IF fancy=2 & colorflag=1 THEN
  5673.         DO
  5674.           IF searcharg~='' THEN
  5675.             DO
  5676.               testpos=POS(UPPER(searcharg),UPPER(lynes.i))
  5677.               IF testpos>0 THEN
  5678.                 SAY LEFT(' ',testpos-1)||pen3||lineup||UPPER(searcharg)||def
  5679.             END
  5680.           IF i=1 THEN
  5681.             IF WORD(lynes.1,3)='Reply' THEN
  5682.               DO
  5683.                 testpos=WORDINDEX(lynes.1,3)
  5684.                 SAY LEFT(' ',testpos-1)||pen3||lineup||SUBSTR(lynes.1,testpos)||def
  5685.               END
  5686.         END
  5687.     END
  5688.   IF i//linesperpage=0 THEN
  5689.     IF waiting2() THEN LEAVE i
  5690. END
  5691. nonstop=0
  5692. RETURN
  5693.  
  5694.  
  5695. readlines:
  5696. CALL CLOSE(f)
  5697. PARSE ARG tempname readstart .
  5698. IF ~readopen(tempname) THEN RETURN 1
  5699. IF readstart<2 THEN lynes.=''
  5700. DO ri=readstart
  5701.   line=READLN(f)
  5702.   IF EOF(f) THEN BREAK
  5703.   lynes.ri=line
  5704. END
  5705. lynes.0=ri-1
  5706. CALL CLOSE(f)
  5707. DO ri=lynes.0 TO 0 BY -1 WHILE LENGTH(lynes.ri)=0 | LEFT(UPPER(lynes.ri),2)='/E' | LEFT(UPPER(lynes.ri),2)='/S'
  5708. END
  5709. lynes.0=ri
  5710. RETURN 0
  5711.  
  5712.  
  5713. savelines:
  5714. PARSE ARG tempname .
  5715. IF EXISTS(tempname) & edtype='MAIL' THEN
  5716.   DO
  5717.     ok=OPEN(f,tempname,'A')
  5718.     IF ok~=0 THEN CALL WRITELN(f,LEFT('',74,'^'))
  5719.   END
  5720. ELSE ok=OPEN(f,tempname,'W')
  5721. IF ok=0 THEN
  5722.   DO
  5723.     line='***' tempname 'failed to open for saving!'
  5724.     SAY line
  5725.     RETURN 1
  5726.   END
  5727. DO wi=1 TO lynes.0
  5728.   CALL WRITELN(f,lynes.wi)
  5729. END
  5730. CALL CLOSE(f)
  5731. RETURN 0
  5732.  
  5733.  
  5734. loaduserlist:
  5735. userlist=SHOWDIR(bbspath'Users')
  5736. ulynes.=''
  5737. IF ~EXISTS(bbspath'Lists/USERS') THEN CALL sortuserlist()
  5738. ELSE IF readopen(bbspath'Lists/USERS') THEN
  5739.   DO
  5740.     SAY 'Loading Userlist...'
  5741.     DO lui=1
  5742.       line=READLN(f)
  5743.       IF EOF(f) THEN BREAK
  5744.       ulynes.lui=line
  5745.     END
  5746.     ulynes.0=lui-1
  5747.     CALL CLOSE(f)
  5748.   END
  5749. RETURN
  5750.  
  5751.  
  5752. saveuserlist:
  5753. SIGNAL OFF BREAK_E
  5754. IF writeopen(bbspath'Lists/USERS') THEN
  5755.   DO
  5756.     DO i=1 TO ulynes.0
  5757.       CALL WRITELN(f,ulynes.i)
  5758.     END
  5759.     CALL CLOSE(f)
  5760.   END
  5761. RETURN
  5762.  
  5763.  
  5764. sortuserlist:
  5765. SAY 'Rebuilding Userlist...'
  5766. sortuserflag=0
  5767. userlist=SHOWDIR(bbspath'Users')
  5768. user.=''
  5769. users=WORDS(userlist)
  5770. user.0=users
  5771. DO uli=1 TO users
  5772.   user.uli=WORD(userlist,uli)
  5773.   uscore=LASTPOS('_',user.uli)
  5774.   IF uscore>0 THEN user.uli=SUBSTR(user.uli,uscore+1)'@'LEFT(user.uli,uscore-1)
  5775. END
  5776. IF users>0 THEN CALL QSORT(1,users,user)
  5777. DO uli=1 TO users
  5778.   uscore=POS('@',user.uli)
  5779.   IF uscore>0 THEN user.uli=SUBSTR(user.uli,uscore+1)'_'LEFT(user.uli,uscore-1)
  5780. END
  5781. ulynes.=''
  5782. ulynes.0=user.0%3
  5783. IF (user.0//3)>0 THEN ulynes.0=ulynes.0+1
  5784. DO i=1 TO ulynes.0
  5785.   ulynes.i=LEFT(user.i,25)
  5786.   DO j=1 TO 2
  5787.     k=i+j*ulynes.0
  5788.     IF k<=users THEN ulynes.i=ulynes.i' 'LEFT(user.k,25)
  5789.   END
  5790. END
  5791. CALL saveuserlist()
  5792. RETURN
  5793.  
  5794.  
  5795. showuserlist:
  5796. IF data.5='' THEN line='Here are the EMail names of your fellow users.'
  5797. ELSE line='   'WORDS(userlist) 'users. Use these names to address messages.'
  5798. SAY pen3||line||def
  5799. DO uli=1 TO ulynes.0
  5800.   SAY ulynes.uli
  5801.   IF uli//linesperpage=0 & uli<ulynes.0 THEN
  5802.     IF waiting2()=1 THEN RETURN
  5803. END
  5804. IF data.5~='' THEN CALL waiting()
  5805. RETURN
  5806.  
  5807.  
  5808. msgcount:
  5809. ARG countdir .
  5810. lastmess=0
  5811. totmsgs=0
  5812. unred=0
  5813. IF ~EXISTS(msgpath||countdir) THEN RETURN
  5814. IF STATEF(msgpath||countdir)=msg.countdir.1 THEN totmsgs=msg.countdir.0
  5815. ELSE
  5816.   DO
  5817.     totmsgs=WORDS(SHOWDIR(msgpath||countdir))
  5818.     msg.countdir.0=totmsgs
  5819.     msg.countdir.1=STATEF(msgpath||countdir)
  5820.   END
  5821. IF countdir>level | FIND(data.21,i)>0 THEN RETURN
  5822. lastread.countdir=WORD(data.22,countdir)
  5823. IF ~DATATYPE(lastread.countdir,'W') THEN lastread.countdir=0
  5824. lastmess=countcheck(bbspath'Numbers/LastMessage'countdir 0)
  5825. IF lastread.countdir<0 THEN RETURN
  5826. firstmess=countcheck(bbspath'Numbers/FirstMessage'countdir 0)
  5827. IF lastread.countdir<firstmess THEN lastread.countdir=firstmess-1
  5828. IF lastmess>0 THEN
  5829.   IF lastread.countdir>=0 THEN
  5830.     DO
  5831.       IF lastread.countdir<(firstmess-1) THEN lastread.countdir=firstmess-1
  5832.       unred=lastmess-lastread.countdir
  5833.       IF unred>totmsgs THEN unred=totmsgs
  5834.       IF unred>0 | ~logonflag THEN
  5835.         DO
  5836.           cline=RIGHT(unred,6) 'new of'
  5837.           cline=cline RIGHT(totmsgs,6) 'online of' RIGHT(lastmess,6)
  5838.           cline=cline 'messages in' RIGHT(countdir,2)',' msg.countdir
  5839.           SAY pen6||cline||def
  5840.         END
  5841.     END
  5842. RETURN
  5843.  
  5844.  
  5845. counts:
  5846. SAY
  5847. SAY 'Working...'
  5848. SAY
  5849. temp=''
  5850. DO i=1 TO 4
  5851.   temp=temp||CENTER(copyright.i,75)||'0A'x
  5852. END
  5853. CALL SETCLIP('BBS_copyright',temp)
  5854. IF emailonline<0 THEN CALL countmail()
  5855. CALL bbsSTATS.rexx(name colorflag 0 emailonline grand grand2 files.0 WORDS(userlist))
  5856. SAY
  5857. CALL waiting2()
  5858. IF waitchar='Q' THEN RETURN
  5859. CALL showmarked(1)
  5860. CALL logonstats()
  5861. nonstop=0
  5862. CALL waiting()
  5863. RETURN
  5864.  
  5865.  
  5866. countmail:
  5867. SAY '   Counting online email...'
  5868. emailonline=0
  5869. DO ti=1 TO WORDS(userlist)
  5870.   emailonline=emailonline+WORDS(SHOWDIR(bbspath'Email/'WORD(userlist,ti)))
  5871. END
  5872. RETURN
  5873.  
  5874.  
  5875. hourly:
  5876. IF level=99 & nonstop~=1 THEN
  5877.   DO
  5878.     IF getinput(1 1 'Zero The Hourly Averages? (Ny) > ')='Y' THEN
  5879.       ADDRESS COMMAND 'C:Delete >*' bbspath'Numbers/Hourly/#?'
  5880.     CALL cleanline(1)
  5881.   END
  5882. CALL ShowHourly.rexx(name linesperpage colorflag nonstop)
  5883. RETURN
  5884.  
  5885.  
  5886. logonstats:
  5887. IF level=0 THEN RETURN
  5888. SAY bak2||name||def 'Last on' DATE('W',lastondate,'I') DATE(,lastondate,'I') lastontime
  5889. tempnum=countcheck(bbspath'Numbers/LastFile' 0)-lastbrowse
  5890. IF tempnum>files.0 THEN tempnum=files.0
  5891. line=RIGHT(files.0,6) 'online of'
  5892. line=line RIGHT(countcheck(bbspath'Numbers/LastFile' 0),6) 'files uploaded.'
  5893. IF tempnum>0 THEN SAY RIGHT(tempnum,6) 'new of' line
  5894. ELSE SAY '    No new of' line
  5895. totmsg=0
  5896. grand=0
  5897. grand2=0
  5898. DO i=1 TO 99
  5899.   IF msg.i='' THEN ITERATE i
  5900.   CALL msgcount(i)
  5901.   totmsg=totmsg+unred
  5902.   grand=grand+totmsgs
  5903.   grand2=grand2+lastmess
  5904. END
  5905. line=RIGHT(grand,6) 'online of' RIGHT(grand2,6) 'public messages written.'
  5906. IF totmsg>0 THEN SAY RIGHT(totmsg,6) 'new of' line
  5907. ELSE SAY '    No new of' line
  5908. RETURN
  5909.  
  5910.  
  5911. readopen:
  5912. PARSE ARG fname
  5913. ok=OPEN(f,fname,'R')
  5914. IF ok~=0 THEN RETURN 1
  5915. line=fname 'failed to open for reading!'
  5916. SAY line
  5917. RETURN 0
  5918.  
  5919.  
  5920. writeopen:
  5921. PARSE ARG fname
  5922. CALL CLOSE(f)
  5923. ok=OPEN(f,fname,'W')
  5924. IF ok~=0 THEN RETURN 1
  5925. line=fname 'failed to open for writing!'
  5926. SAY line
  5927. RETURN 0
  5928.  
  5929.  
  5930. set_grand:
  5931. SAY 'Setting up public message conferences...'
  5932. grand=0
  5933. DO i=1 TO 99
  5934.   IF msg.i='' THEN ITERATE i
  5935.   msg.i.0=WORDS(SHOWDIR(msgpath||i,'F'))
  5936.   msg.i.1=STATEF(msgpath||i)
  5937.   grand=grand+msg.i.0
  5938. END
  5939. RETURN
  5940.  
  5941.  
  5942. SYNTAX:
  5943. FAILURE:
  5944. lin.1=pen7||ERRORTEXT(RC)||def
  5945. lin.2=SIGL-1     SOURCELINE(SIGL-1)
  5946. lin.3=SIGL pen7||SOURCELINE(SIGL)||def
  5947. lin.4=SIGL+1     SOURCELINE(SIGL+1)
  5948. DO er=1 TO 4
  5949.   SAY lin.er
  5950. END
  5951. IF newpassword='' THEN SIGNAL DONE2  /* no user logged on, quit quietly */
  5952. CALL CLOSE(f)
  5953. IF level>sysoplevel THEN
  5954.   DO
  5955.     junk=getinput(1 1 'ReStart: (Ny) > ')
  5956.     IF junk~='Y' THEN SIGNAL LOGOUT
  5957.   END
  5958. string=''
  5959. waitchar=''
  5960. IF data.1~='' & data.5~='' & data.20~='' THEN CALL savedata(0)
  5961. SIGNAL RESTART
  5962.  
  5963.  
  5964. BREAK_E:
  5965. CALL CLOSE(f)
  5966. SAY pen3'*** CTRL-E BREAK ***'def
  5967. waitchar=''
  5968. string=''
  5969. nonstop=0
  5970. rnonstop=0
  5971. brostop=0
  5972. i=999999
  5973. wi=999999
  5974. ni=-1
  5975. SAY
  5976. RETURN 0
  5977.  
  5978.  
  5979. BREAK_C:
  5980. CALL CLOSE(f)
  5981.  
  5982. LOGOUT:
  5983. LOGOUT2:
  5984. secs=TIME('E')
  5985. mins=secs%60
  5986. secs=TRUNC(secs//60)
  5987. IF secs<10 THEN secs='0'secs
  5988. SAY
  5989. SAY 'Public messages now online: 'RIGHT(comma(grand),9)
  5990. SAY 'Public    files now online: 'RIGHT(comma(files.0),9)
  5991. SAY
  5992. SAY 'Time used this call:' mins':'secs
  5993. SAY
  5994. arg=bbspath'BBS_TEXT/GOODBYE'
  5995. IF EXISTS(arg) THEN
  5996.   DO
  5997.     CALL DELAY(14)
  5998.     CALL readlines(arg 1)
  5999.     nonstop=1
  6000.     CALL seelines(0)
  6001.     nonstop=0
  6002.   END
  6003. SAY
  6004. IF bbsprefs.2 THEN CALL doGrin()
  6005. SAY 
  6006. CALL bbsLOGOFF.baud(name level 0)
  6007.  
  6008. OUT:
  6009. data.18=winnings
  6010.  
  6011. OUT2:
  6012.  
  6013. DONE:
  6014.  
  6015. DONE2:
  6016. CALL SETCLIP('BBS_LOCAL')
  6017. CALL SETCLIP('BBS_LOCAL_MSG')
  6018. IF newfilesflag=1 THEN
  6019.   DO
  6020.     newfilesdate=DATE('S') TIME()
  6021.     lastbrowse=countcheck(bbspath'Numbers/LastFile' 0)
  6022.   END
  6023. IF clear_marked=1 THEN data.24=''
  6024. CALL saveData(0)
  6025. IF EXISTS(bbspath'EmailFiles/'name'/QUICKIN.lha') THEN
  6026.   ADDRESS AREXX bbsQUICKIN.rexx name level sysoplevel bbsprefs.6
  6027. IF sortuserflag=1 THEN
  6028.   DO
  6029.     CALL sortuserlist()
  6030.     IF SHOW('P','BBBBS') THEN
  6031.       DO
  6032.         CALL SETCLIP('BBS_mainusers')
  6033.         CALL SETCLIP('BBS_localusers',1)
  6034.       END
  6035.     sortuserflag=0
  6036.   END
  6037. IF sortalphaflag>0 | savefileflag>0 THEN
  6038.   DO
  6039.     IF savefileflag>0 THEN CALL savefilelist2()
  6040.     ELSE CALL savealphalist()
  6041.     IF SHOW('P','BBBBS') THEN CALL SETCLIP('BBS_localfiles',2)
  6042.   END
  6043. IF getinput(1 1 'Reset for next local user? (nY) > ')='N' THEN EXIT
  6044. clear_marked=0
  6045. data.=''
  6046. SIGNAL BIG_LOOP
  6047.  
  6048.  
  6049. checkclips:
  6050. IF GETCLIP('BBS_mainusers')~='' THEN
  6051.   DO
  6052.     CALL loaduserlist()
  6053.     CALL SETCLIP('BBS_mainusers')
  6054.   END
  6055. IF GETCLIP('BBS_mainfiles')~='' & GETCLIP('BBS_maint')='' THEN
  6056.   DO
  6057.     CALL SETCLIP('BBS_mainfiles')
  6058.     CALL loadfiles()
  6059.     CALL loadalpha()
  6060.   END
  6061. RETURN
  6062.  
  6063.  
  6064. checkalias:
  6065. addressee=''
  6066. IF alias.0=0 THEN RETURN 0
  6067. DO i=1 TO alias.0
  6068.  IF UPPER(alias.i)=UPPER(string) THEN
  6069.   DO
  6070.    addressee=realname.i
  6071.    LEAVE i
  6072.   END
  6073. END
  6074. IF addressee='' THEN RETURN 0
  6075. string=''
  6076. SAY pen3'Email to 'def||addressee
  6077. CALL editor('MAIL' addressee)
  6078. RETURN 0
  6079.  
  6080.  
  6081. Friends:
  6082. ch=''
  6083. aliasexclude='sysop bye off'
  6084. DO WHILE ch~='Q'
  6085.   SAY
  6086.   SAY pen3||LEFT('=',75,'=')def
  6087.   SAY CENTER('F R I E N D S - L I S T',75)
  6088.   SAY
  6089.   SAY CENTER('A L I A S   E D I T O R',75)
  6090.   SAY pen3||LEFT('=',75,'=')def
  6091.   SAY
  6092.   SAY '                           'pen3'W - 'def'What is the Friends List? '
  6093.   SAY '                           'pen3'A - 'def'Add an Alias '
  6094.   SAY '                           'pen3'D - 'def'Delete an Alias '
  6095.   SAY '                           'pen3'V - 'def'View my Aliases '
  6096.   SAY '                           'pen3'Q - 'def'Return to Main Menu'
  6097.   SAY
  6098.   ch=getinput(1 1 pen3'Enter Choice > 'def)
  6099.   SELECT
  6100.     WHEN ch='W' THEN CALL whatFriends()
  6101.     WHEN ch='A' THEN CALL addalias()
  6102.     WHEN ch='D' THEN CALL delalias()
  6103.     WHEN ch='V' THEN CALL viewalias()
  6104.     WHEN ch='Q' THEN CALL saveFriends()
  6105.     OTHERWISE SAY 'No such command'
  6106.   END
  6107. END
  6108. string=''
  6109. RETURN
  6110.  
  6111.  
  6112. saveFriends:
  6113. frn=bbspath'Friends/'name
  6114. IF alias.0<1 THEN
  6115.   DO
  6116.     CALL DELETE(frn)
  6117.     RETURN
  6118.   END
  6119. CALL OPEN(f,frn,'W')
  6120. DO i=1 TO alias.0
  6121.   CALL WRITELN(f,alias.i'  'realname.i)
  6122. END
  6123. CALL CLOSE(f)
  6124. RETURN
  6125.  
  6126.  
  6127. whatFriends:
  6128. CALL readlines(bbspath'Information/BBBBS.Friends' 1)
  6129. CALL cleanline(0)
  6130. CALL seelines(0)
  6131. IF waitchar~='Q' THEN CALL waiting()
  6132. nonstop=0
  6133. RETURN
  6134.  
  6135.  
  6136. addalias:
  6137. match=0
  6138. username=getinput(1 0 pen3'Enter Users Email Name > 'def)
  6139. username=cleanstring(1':'username)
  6140. IF username='' THEN RETURN
  6141. IF FIND(userlist,username)=0 THEN 
  6142.  DO
  6143.   SAY 'Username not found'
  6144.   RETURN
  6145.  END 
  6146. newalias=getinput(1 0 pen3'Enter an Alias for'def' 'username def'> ')
  6147. IF newalias='' THEN RETURN
  6148. IF alias.0>0 THEN
  6149.   DO i=1 TO alias.0
  6150.    IF UPPER(alias.i)=UPPER(newalias) THEN match=1
  6151.   END
  6152. IF FIND(aliasexclude,newalias)>0 THEN match=2
  6153. IF match=0 THEN 
  6154.   DO 
  6155.    alias.0=alias.0+1
  6156.    num=alias.0
  6157.    alias.num=newalias
  6158.    realname.num=username
  6159.    SAY alias.num 'alias as ' realname.num 'added'
  6160.   END
  6161. ELSE IF match=1 THEN SAY 'Alias 'newalias' already exists'
  6162. ELSE SAY newalias ' is a reserved name'
  6163. RETURN
  6164.  
  6165.  
  6166. delalias:
  6167. match=0
  6168. dalias=getinput(1 0 pen3'Enter Alias to Delete > 'def)
  6169. dalias=UPPER(WORD(dalias,1))
  6170. IF alias.0>0 THEN
  6171.   DO i=1 TO alias.0
  6172.    IF UPPER(alias.i)=UPPER(dalias) THEN 
  6173.     DO 
  6174.      match=1
  6175.      num=i
  6176.      LEAVE i
  6177.     END
  6178.   END
  6179. IF match=1 THEN 
  6180.  DO
  6181.   IF getinput(1 1 'Really Delete 'dalias'? (Ny) > ')='Y' THEN
  6182.    DO
  6183.     DO i=num TO alias.0
  6184.      j=i+1
  6185.      alias.i=alias.j
  6186.      realname.i=realname.j
  6187.     END
  6188.     alias.0=alias.0-1
  6189.    END
  6190.  END
  6191. ELSE SAY dalias' not Found.'
  6192. RETURN
  6193.  
  6194.  
  6195. viewalias:
  6196. IF alias.0>0 THEN
  6197. DO i=1 TO alias.0
  6198.  SAY RIGHT(alias.i,20) 'is' realname.i
  6199. END
  6200. ELSE SAY 'No Aliases assigned'
  6201. RETURN
  6202.  
  6203.  
  6204. /* bbsLOCAL.rexx */
  6205.  
  6206.  
  6207. /*  Userfile Data definitions */
  6208.  
  6209.  1 name
  6210.  2 address
  6211.  3 city state country zip
  6212.  4 telephone
  6213.  5 password
  6214.  6 protocol
  6215.  7 lines per page
  6216.  8 Preferences: MENUS COLOR STREET PHONE etc. On list=YES, ON or PUBLIC.
  6217.  9 Computer model
  6218. 10 interests        ! SYSOP edit only below this line !
  6219. 11 nn minutes per call, nn calls per day, nn more calls today
  6220. 12 first date on.  timestamp  Birthday: birthday
  6221. 13 last  date on BBS in 'S' form for rexx DATE().
  6222. 14 uploaded files bytes lastdate
  6223. 15 downloaded files bytes lastdate
  6224. 16 lastfilebrowsed lastfilelistdate lastfilelisttime
  6225. 17 ul:dl_ratio  total_email_written  last_email_read_(sysop only)
  6226. 18 winnings
  6227. 19 total time on this BBS in hours minutes calls
  6228. 20 level
  6229. 21 exclude dirs by name (conferences by number), separated by spaces.
  6230. 22 oldest messages read
  6231. 23 total msgs written per conference
  6232. 24 Marked message list  msgdirnum/msgnum
  6233. 25 filenumbers to download (temporary)
  6234. 26 QUICK exclude list
  6235. 27 Call Back Verify Number(s)
  6236.  
  6237. /* end data defines */
  6238.